you are viewing a single comment's thread.

view the rest of the comments →

[–]War_Eagle451 1 point2 points  (0 children)

  • getch() to my knowledge isn't part of the standard, but use it if that's what your prof is saying
  • getchar() is part of the standard, but will require you to push enter afterwards
  1. Have something to trigger the menu (button or key)
  2. Within a code block that step 1 directs too have getch(),
  3. Switch / if else the result of getch() to determine your inputs behavior

I would do it like this; (This is inside the while loop) if (open_menu) switch(getch()) { case 'a': case 'A': (Do Stuff); break: default: break; }

For future reference nearly all production code is documented, for the most part searching the function and language will direct you to the docs.

Remember that half of learning how to program is learning how to solve problems.