Borland TURBO Cが MS-DOS/Windows 用にのみ提供する標準関数ではないため、getchar()
代わりにC 標準ライブラリ関数を使用してください。getch()
printf("Let the Battle Begin!\n");
printf("Press Any Key to Continue\n");
getchar();
ここでgetchar()
は、リターン キーを押すprintf
必要があるため、ステートメントはpress ENTER to continue
. 別のキーを押しても、ENTER を押す必要があります。
printf("Let the Battle Begin!\n");
printf("Press ENTER key to Continue\n");
getchar();
Windowsを使用している場合は、使用できますgetch()
printf("Let the Battle Begin!\n");
printf("Press Any Key to Continue\n");
getch();
//if you press any character it will continue ,
//but this is not a standard c function.
char ch;
printf("Let the Battle Begin!\n");
printf("Press ENTER key to Continue\n");
//here also if you press any other key will wait till pressing ENTER
scanf("%c",&ch); //works as getchar() but here extra variable is required.