At Uni we have to programm LIFE and have to make therefore a menu. To read the user's input of the menu we should write a reading function which processes/removes the newlines/enter. We wrote following:
char reading ( ) {
char input ;
while (input != '/n') {
cin.get (input) ;
return input;
}
}
If we replace now cin with this function it prints our menu twice after we enterd the first menu option. If we enter something like kkk which is no option of the menu, it prints the menu 4 times. I asked one of the helping assistants and he didn't know and found that the function seems correct and that it is probably something very obvious what he doesn't know right now. It's also said to be nothing wrong with our menu-code. Do you have an idea what maybe went wrong and can explain it to me? Thanks a lot!