I used the fflush() in Linux GCC but it did not work. Are there any alternatives for that function? Here is my code:
#include
void main()
{
fflush() doesn't do much for input streams but since scanf() never returns this doesn't matter. scanf() blocks because the terminal window doesn't send anything to the C program until you press Enter
You have two options:
10 EnterThe second option has many drawbacls like you will lose editing capabilities, so I suggest to read the input line by line.