Thread: Can't call from within switch?

  1. #16
    Registered User TheWhiffet's Avatar
    Join Date
    Apr 2011
    Location
    Hell.
    Posts
    14
    @laserlight; I've edited my first post to show the code I currently have. I just can't get them to call from the menu.

    Also for ArunS, I was trying not to use global variables. XD

  2. #17
    Registered User
    Join Date
    Apr 2011
    Location
    dust
    Posts
    70
    Quote Originally Posted by TheWhiffet View Post
    @laserlight; I've edited my first post to show the code I currently have. I just can't get them to call from the menu.

    Also for ArunS, I was trying not to use global variables. XD
    You are trying to access the variables "cresult, cinput, result, input" from menu function which are all defined in the main function. So definitely you will get an error "undeclared identifier".
    And you are trying to avoid global variables, So better pass those variables as an arguments in the menu function.

  3. #18
    Registered User TheWhiffet's Avatar
    Join Date
    Apr 2011
    Location
    Hell.
    Posts
    14
    Done. Thank you guys for the help! I got it to work now. .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help!! call-by-reference and call-by-value
    By geoffr0 in forum C Programming
    Replies: 14
    Last Post: 04-01-2009, 07:15 PM
  2. A switch that doesn't switch
    By Death_Wraith in forum C++ Programming
    Replies: 5
    Last Post: 11-06-2004, 12:18 PM
  3. C system call and library call
    By Coconut in forum C Programming
    Replies: 6
    Last Post: 08-22-2002, 11:20 AM
  4. Call-by-value Vs. Call-by-reference
    By Wiz_Nil in forum C++ Programming
    Replies: 3
    Last Post: 02-20-2002, 09:06 AM
  5. call by reference and a call by value
    By IceCold in forum C Programming
    Replies: 4
    Last Post: 09-08-2001, 05:06 PM