Hi this is just a simple question for programing in C.


I have my main function using a while loop that gets 1 character at a time from the user.

When the user enter '1' it calls a different method add().

add() also asks the user for some input and does a simliair loop asking scanning in 1 character at a time.. The problem is that when I try inputing something in now it jumps back to the main loop.

For Example:

Please enter choice from 1-6:
(I enter 1)
It calls add()
Please enter number:
(I enter 54)
It goes back to the main method without doing anything and gives me:
Error: Please only enter number from 1-6.


How do i make it so it stays in the add method until i actually return?

Thx.