On windows
char c; int i; scanf("%d", &i); scanf("%c", &c);
The computer skips the character from the console because '\ n' remains in the buffer. However, I found out that the code below works well.
char str[10]; int i; scanf("%d", &i); scanf("%s", str);
As in the case above, '\ n' remains in the buffer, but why does scanf successfully get the line from the console this time?
source share