Thread: Stack problem

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    21

    Smile Stack problem

    I am having trouble getting my program work. I have attched the files!! It stops when I have to print out whats left..and my counter is not working properly for cars- it should never report that lot is full because it should never be full!! Any body wanna help??

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    21
    Ok- how do you post more than one document??

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by riley03
    Ok- how do you post more than one document??
    You can only do one per thread. But you should only be posting the parts of your code relevant to the problem you are having, please don't post your complete project
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    21
    I believe that this is the part ( my implemation) that is throwing the program....
    void Stack::Print () {
    if (! IsEmpty() ) {


    Node* q= parkinglot->ptr;

    while (q !=NULL) {
    cout << q->datum << endl;
    q=q->ptr;
    };
    };
    when I call it- it doesn't work.....is this enough info to suggest anything??

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    drop the semicolons after the closing curly brackets

  6. #6
    Seeking motivation... endo's Avatar
    Join Date
    May 2002
    Posts
    537
    and use code tags!! Look at Hammer's signature above
    Couldn't think of anything interesting, cool or funny - sorry.

  7. #7
    Registered User
    Join Date
    Feb 2002
    Posts
    21

    Talking

    Thanks Guys!! I successfully completed my StackClass project called Bashemin Parking Lot!! Nice name huh?? I wanted to bash my head softly , of course, against the computer!!! Thanks again- and I promise I will get better at formatting!!
    ~Carrie

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Problem?
    By audinue in forum C++ Programming
    Replies: 3
    Last Post: 05-16-2009, 11:28 AM
  2. Stack problem - I've hit a wall!
    By miniwhip in forum C Programming
    Replies: 7
    Last Post: 11-14-2007, 03:05 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Having problem deleting node in middle of stack
    By sballew in forum C Programming
    Replies: 3
    Last Post: 10-29-2001, 11:00 AM
  5. Stack Program Here
    By Troll_King in forum C Programming
    Replies: 7
    Last Post: 10-15-2001, 05:36 PM