3 Replies - 4450 Views - Last Post: 13 January 2010 - 04:16 PM Rate Topic: -----

#1 samr3y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-January 10

how to create a stack in C++ in easy way to understand

Posted 11 January 2010 - 08:24 PM

Can someone help me or can give codes on how to create a stack in C++ in easier way? hope anyone of you can help me. I am a beginner of making a stack in C++. I'm hoping that I can learn this kind of program. :blink:
Is This A Good Question/Topic? 0
  • +

Replies To: how to create a stack in C++ in easy way to understand

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,662
  • Joined: 23-August 08

Re: how to create a stack in C++ in easy way to understand

Posted 13 January 2010 - 03:57 PM

Moved from Tutorials
Was This Post Helpful? 0
  • +
  • -

#3 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3120
  • View blog
  • Posts: 19,165
  • Joined: 14-September 07

Re: how to create a stack in C++ in easy way to understand

Posted 13 January 2010 - 04:06 PM

You were in the right section. Look in the C++ tutorials, there's quite a few data structure ones.
Was This Post Helpful? 0
  • +
  • -

#4 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: how to create a stack in C++ in easy way to understand

Posted 13 January 2010 - 04:16 PM

Easy way to create a stack in C++: use std::stack

#include <stack>

...


std::stack<int> myStack;
myStack.push_back(25);
std::cout << myStack.pop_back();

...


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1