sleepyjess:

blah blah blah

4 weeks ago
sleepyjess:

don't have everything in so far, but I'll explain the problem after I post what I have

4 weeks ago
sleepyjess:

it calls the `menu(menuSelection);` function properly, but not either of the others I have in

4 weeks ago
nuts:

can you link to pastebin?

4 weeks ago
sleepyjess:

what's that?

4 weeks ago
sleepyjess:

want me to put everything I have so far?

4 weeks ago
nuts:

wait what exactly is the problem?

4 weeks ago
sleepyjess:

just not sure why it isn't calling those functions corrently

4 weeks ago
sleepyjess:

*correctly

4 weeks ago
sleepyjess:

would a switch be better for this?

4 weeks ago
nuts:

you have a local/global variable problem. try moving the menuSelection variable before your main to make it a global variable so the functions can all operate on it @sleepyjess

4 weeks ago
nuts:

move menuSelection above int main()

4 weeks ago
nuts:

line 12 to line 9

4 weeks ago
sleepyjess:

and would line 13 need to be moved up also?

4 weeks ago
sleepyjess:

still doesn't work either way... just keeps running that first loop

4 weeks ago
nuts:

can you update your code with what you have real quick and i'll try to run it

4 weeks ago
sleepyjess:

updated

4 weeks ago
nuts:

in your "menu" function remove the argument int menuSelection and remove it in the call inside main (lines 47, 16, and 4) and try running without arguments. You're shadowing the global (you'd need the global keyword to write to it, but you don't need that argument in the function anyways)

4 weeks ago
nuts:

@sleepyjess

4 weeks ago
sleepyjess:

Yay!!! That worked!!

4 weeks ago
sleepyjess:

thank you so so so much, I really did not think it would take this long to find the issue

4 weeks ago
nuts:

yeah global and local variables are always a huge frustration the first time you encounter them since the behavior is completely unexpected

4 weeks ago
sleepyjess:

first time really having to work with declaring functions in general, so still a bit iffy on what I'm doing there

4 weeks ago
Similar Questions: