-
Help with class stack!
I need to know how to: create a class which stacks floating point numbers...... if anyone can help i would be very happy!!!
this is probably as basic as you can get or something but im new to programming and i finaly got to this site and i hope you all can help me!
-
Do you know what a stack is and how it operates?
What c++ constructs are you comfortable with? This will probably require you to know simple classes and operator overloading,functions and pointers as a minimum.
When you have searched the web and know what a stack is and how it operates try to code one on your own. You will get much more help coming back here then with your effort even if its broken.When you post your code dont forget to first read the FAQ and then use code tags in your post. (check the stickies for details).
-
First, picture what a stack is.
Imagine a stack of dirty dishes that need to be washed. The first plate goes down(push is the traditional name for this). Then, the second plate goes on top. Then, the third... The first plate that you wash(pop is the traditional name for this) is going to be the last one that you put on. The last plate to be washed(popped) is going to be the first plate.