Thread: Stack topElem function question

  1. #1
    Registered User verbity's Avatar
    Join Date
    Nov 2006

    Stack topElem function question

    I have a function to get the top element from a stack...but I'm having a problem calling it

    void stack::topElem(el_t& elem)
    		stackError("stack is empty");
    		elem = el[top];
    problem is I didn't write this the professor did...I would've just returned something but I have no idea what to put in the parameters. I though possibly this:

    f ((let != '*') && (let != '+') && (let != '-') && (let != '/'))

    Those ??? symbolize my confusion. Any help would be appreciated....

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    As you can see by the "&" in the parameter declaration, the function can change the parameter passed in. So whatever you want the function to change, you pass in.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 12:49 PM
  3. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 05:32 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. stack make file problem
    By puckett_m in forum C Programming
    Replies: 2
    Last Post: 11-22-2001, 10:51 AM
Website Security Test