Click here to Skip to main content
14,693,505 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
Questionkernel32.lib Pin
CalinNegru(fearless_)18-May-20 12:10
MemberCalinNegru(fearless_)18-May-20 12:10 
AnswerRe: kernel32.lib Pin
Daniel Pfeffer18-May-20 20:49
professionalDaniel Pfeffer18-May-20 20:49 
GeneralRe: kernel32.lib Pin
CalinNegru(fearless_)19-May-20 1:02
MemberCalinNegru(fearless_)19-May-20 1:02 
QuestionHow is this possible? Pin
Tim ONeil17-May-20 5:47
MemberTim ONeil17-May-20 5:47 
AnswerRe: How is this possible? Pin
Richard MacCutchan17-May-20 6:31
mveRichard MacCutchan17-May-20 6:31 
GeneralRe: How is this possible? Pin
Tim ONeil17-May-20 6:39
MemberTim ONeil17-May-20 6:39 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 7:28
mveRichard MacCutchan17-May-20 7:28 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 23:12
mveRichard MacCutchan17-May-20 23:12 
Here is a version that builds, but without most of the implementation. I am not sure how much this differs from what you tried.
typedef int T; // I am not sure about this, but it seems to work.
#include "stack.h"
#include <iostream>

template <class t>
stack<t>::stack()
{
    _head = nullptr;
    _size = 0;
}

template <class t>
stack<t>::~stack()
{
    // empty destructor
}

template <class t>
size_t stack<t>::size() const
{
    //return the size of the stack
    return _size;
}

template <class t>
T& stack<t>::top() const
{
    //return a reference to the top value. Throw an exception if the stack is empty.
    return _head->_data;
}

template <class t>
void stack<t>::push(const T& item)
{
    //push a new value onto the stack
}

template <class t>
void stack<t>::pop()
{
    //remove the top value from the stack. Do nothing if the stack is empty.
}

template <class t>
void stack<t>::invert()
{
    //reverse the order of the entire stack, so that 1,2,3,4,5 becomes 5,4,3,2,1 and so on.
}

int main()
{
    stack<int> myStack;
    std::cout << "stack size = " << myStack.size() << std::endl;

    return 0;
}


modified 18-May-20 5:09am.

GeneralRe: How is this possible? Pin
Richard MacCutchan20-May-20 0:55
mveRichard MacCutchan20-May-20 0:55 
AnswerRe: How is this possible? Pin
Mircea Neacsu19-May-20 4:09
MemberMircea Neacsu19-May-20 4:09 
PraiseRe: How is this possible? Pin
Greg Utas19-May-20 4:37
professionalGreg Utas19-May-20 4:37 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:37
mveRichard MacCutchan19-May-20 4:37 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 4:57
MemberMircea Neacsu19-May-20 4:57 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 5:16
mveRichard MacCutchan19-May-20 5:16 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 6:08
MemberMircea Neacsu19-May-20 6:08 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 6:24
mveRichard MacCutchan19-May-20 6:24 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 7:07
MemberMircea Neacsu19-May-20 7:07 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 22:36
mveRichard MacCutchan19-May-20 22:36 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 3:40
MemberMircea Neacsu20-May-20 3:40 
GeneralRe: How is this possible? Pin
Richard MacCutchan20-May-20 0:22
mveRichard MacCutchan20-May-20 0:22 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 3:44
MemberMircea Neacsu20-May-20 3:44 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 5:18
mveRichard MacCutchan19-May-20 5:18 
AnswerRe: How is this possible? Pin
Richard MacCutchan19-May-20 22:38
mveRichard MacCutchan19-May-20 22:38 
QuestionQueryPerformanceCounter Pin
CalinNegru(fearless_)16-May-20 3:16
MemberCalinNegru(fearless_)16-May-20 3:16 
AnswerRe: QueryPerformanceCounter Pin
Greg Utas16-May-20 3:29
professionalGreg Utas16-May-20 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.