This would be better
printf("Hit 'ENTER' to exit\n");
fflush(stdout);
(void)getchar();
I'd like to know more about why this is better. I understand the fflush to force the buffered printf output to the screen immediately. But why the cast to void for getchar's return value? Does this prevent allocation of bytes for the int ?
Last edited by hollystyles; Aug 29th, 2007 at 9:29 am.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
Offline 1,181 posts
since Feb 2005