EDIT 1:
I would like to have a program that checks for enter key pressed and then skip some code after it (kind of like some games that have the skippable screens when you launch them). But I don't want it to wait for the input.
if(getchar()=='\n')
{
goto skip;
}
ClearScreen();
printf("%s Welcome to Guy's game!\n\n");
Sleep(500);
ClearScreen();
printf("%s Welcome to Guy's game!\n\n");
Sleep(500);
ClearScreen();
printf("%s Welcome to Guy's game!\n\n");
Sleep(500);
ClearScreen();
printf("%s Welcome to Guy's game!\n\n");
Sleep(500);
ClearScreen();
//this is the where it should skip
skip:
printf("%s Welcome to Guy's game!\n\n");
printf("Please enter your name: ");
gets(name);
Sleep(250);
I want it to check for enter while it prints "Welcome to Guy's game!" so that no matter when I press enter (as long as it's printing "Welcome to Guy's game!") I can skip to the last part of the code. I can't figure out how to get this to work.
UPDATE:
I have one more question that I forgot to ask.. How can I fix "warning: implicit declaration of function 'Sleep', when I use:
ClearScreen();
printf("%s Welcome to Guy's game!\n\n");
Sleep(500);
inside a for loop.