- #1
Deathfish
- 86
- 0
Homework Statement
How do I erase previous lines displayed from printf function? (use printf, scanf etc)
Welcome to Sample Program
[Press Enter to Start]
When I press Enter, the [Press Enter to Start] should disappear.
Homework Equations
- nil -
The Attempt at a Solution
unsigned char mainstart=0;
printf("SAMPLE PROGRAM");
printf("\n==============================");
while(mainstart!=1)
{
printf("\n[Press Enter to start]");
getch();
while(getch() != 0x0d);
if(getch() == 0x0d)
{
mainstart=1;
}
}
Also, why does my code only function when I press Enter three times? How do I alter the program to function by pressing Enter only once?