Hello, I am new to programming and I am writing a program in C.
In my header file, I have this macro:
#define yesno(c) (c==ENTER || c==' ' || c=='\t') ? ENTER : ESC
In my program, I have this code
char keypressed() { char c; c =getch(); return yesno(getch()); }
So I wanted to ask why, when I ask to return yesno(c) , I have to press the button only once, and when I use return yesno(getch()) , should I press the button one or two times more?
Is there a problem with getch() when called from a macro?
source share