I am reading input from the keyboard to store in variables.
char foo[BUFFER_SIZE];
printf("Enter your string");
fgets(foo, BUFFER_SIZE, stdin);
printf("Enter another thingy");
However, the program does not wait for user input and directly goes to the second printf(). How can I fix this? I tried using a while loop but then I reach an infinite loop...