sleepyjess:

blah blah blah

2 months ago
sleepyjess:

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

2 months ago
sleepyjess:

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

2 months ago
nuts:

can you link to pastebin?

2 months ago
sleepyjess:

what's that?

2 months ago
sleepyjess:

want me to put everything I have so far?

2 months ago
nuts:

wait what exactly is the problem?

2 months ago
sleepyjess:

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

2 months ago
sleepyjess:

*correctly

2 months ago
sleepyjess:

would a switch be better for this?

2 months 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

2 months ago
nuts:

move menuSelection above int main()

2 months ago
nuts:

line 12 to line 9

2 months ago
sleepyjess:

and would line 13 need to be moved up also?

2 months ago
sleepyjess:

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

2 months ago
nuts:

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

2 months ago
sleepyjess:

updated

2 months 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)

2 months ago
nuts:

@sleepyjess

2 months ago
sleepyjess:

Yay!!! That worked!!

2 months ago
sleepyjess:

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

2 months ago
nuts:

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

2 months ago
sleepyjess:

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

2 months ago
Similar Questions: