Ignore carriage returns in scanf before data.... to keep layout of console based graphics with conio
- by volting
I have the misfortune of having use conio.h in vc++ 6 for a college assignment,
My problem is that my graphic setup is in the center of the screen...
e.g.
gotoxy( getcols()/2, getrows()/2);
printf("Enter something");
scanf( "%d", &something );
now if someone accidentally hits enter before they enter the "something", then the cursor gets reset to the left of the screen on the next line.
Iv tried flushing the keyboard and bios buffers with fflush(stdin) and getchar(), which like I expected didn't work!
Any help/ideas would be appreciated,
Thanks,
V