Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionkernel32.lib Pin
Calin Negru18-May-20 11:10
Calin Negru18-May-20 11:10 
AnswerRe: kernel32.lib Pin
Daniel Pfeffer18-May-20 19:49
professionalDaniel Pfeffer18-May-20 19:49 
GeneralRe: kernel32.lib Pin
Calin Negru19-May-20 0:02
Calin Negru19-May-20 0:02 
QuestionHow is this possible? Pin
Tim ONeil17-May-20 4:47
Tim ONeil17-May-20 4:47 
AnswerRe: How is this possible? Pin
Richard MacCutchan17-May-20 5:31
mveRichard MacCutchan17-May-20 5:31 
GeneralRe: How is this possible? Pin
Tim ONeil17-May-20 5:39
Tim ONeil17-May-20 5:39 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 6:28
mveRichard MacCutchan17-May-20 6:28 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 22:12
mveRichard MacCutchan17-May-20 22: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.
C++
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 MacCutchan19-May-20 23:55
mveRichard MacCutchan19-May-20 23:55 
AnswerRe: How is this possible? Pin
Mircea Neacsu19-May-20 3:09
Mircea Neacsu19-May-20 3:09 
PraiseRe: How is this possible? Pin
Greg Utas19-May-20 3:37
professionalGreg Utas19-May-20 3:37 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 3:37
mveRichard MacCutchan19-May-20 3:37 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 3:57
Mircea Neacsu19-May-20 3:57 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:16
mveRichard MacCutchan19-May-20 4:16 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 5:08
Mircea Neacsu19-May-20 5:08 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 5:24
mveRichard MacCutchan19-May-20 5:24 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 6:07
Mircea Neacsu19-May-20 6:07 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 21:36
mveRichard MacCutchan19-May-20 21:36 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 2:40
Mircea Neacsu20-May-20 2:40 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 23:22
mveRichard MacCutchan19-May-20 23:22 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 2:44
Mircea Neacsu20-May-20 2:44 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:18
mveRichard MacCutchan19-May-20 4:18 
AnswerRe: How is this possible? Pin
Richard MacCutchan19-May-20 21:38
mveRichard MacCutchan19-May-20 21:38 
QuestionQueryPerformanceCounter Pin
Calin Negru16-May-20 2:16
Calin Negru16-May-20 2:16 
AnswerRe: QueryPerformanceCounter Pin
Greg Utas16-May-20 2:29
professionalGreg Utas16-May-20 2: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.