Thread: Help with class stack!

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    1

    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!

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    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).
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Need Help with Stack
    By trongsi in forum C++ Programming
    Replies: 9
    Last Post: 05-23-2006, 04:14 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Finished Stack
    By the pooper in forum C Programming
    Replies: 11
    Last Post: 02-02-2005, 10:52 AM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM