Hello C board,
At the end of my C program, I want to ask to the user if he want to start again, simply by pressing y or n. So I wrote this :
OK, this works, but at the first scanf in my program (to ask to the user to enter a number for example), the 'y' is displayed on the screen, so the user have to erase it with backspace before entering the number.Code:void main() { char a$; ... ... ... printf("Start again (y/n)"); a$=getch(); if (a$=='y') main(); }
How can I change this behaviour ?
All the best
Pierre



LinkBack URL
About LinkBacks


