to put it simply when you do something like this:
printf("enter a key:");
that text is sent to a buffer, which is not actually printed to the screen (or wherever stdout is hooked to) until it reaches a \n or something like what fflush() does (or tries to do) is print everything thats currently in the buffer, to the screen.