blah blah blah
don't have everything in so far, but I'll explain the problem after I post what I have
it calls the `menu(menuSelection);` function properly, but not either of the others I have in
can you link to pastebin?
what's that?
want me to put everything I have so far?
wait what exactly is the problem?
just not sure why it isn't calling those functions corrently
*correctly
would a switch be better for this?
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
move menuSelection above int main()
line 12 to line 9
and would line 13 need to be moved up also?
still doesn't work either way... just keeps running that first loop
can you update your code with what you have real quick and i'll try to run it
updated
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)
@sleepyjess
Yay!!! That worked!!
thank you so so so much, I really did not think it would take this long to find the issue
yeah global and local variables are always a huge frustration the first time you encounter them since the behavior is completely unexpected
first time really having to work with declaring functions in general, so still a bit iffy on what I'm doing there
Join our real-time social learning platform and learn together with your friends!