[英]How to make the output stay on the screen for a period of time in Win32 app
我試圖顯示傳遞到回車的功能的答案被按下。輸出消失了,我看不到它。
void answer(int p[][numCols],int count)
{
printf("\n");
printf("Please press enter to end");
printf("The answer is : %i",p[count][3]);
char c=getchar();
while (c != '\n')
{
c=getchar();
}
}
可以在這里找到代碼: https : //codereview.stackexchange.com/questions/9419/programming-of-3-x-7-trick
我正在使用Microsoft Visual Studio Ulimate2010。需要一些指導來解決它。
試試這個功能答案:
void answer(int p[][numCols],int count)
{
char c;
printf("\n");
printf("Please press enter to end");
printf("The answer is : %i",p[count][3]);
while((c = getchar()) != '\n')
;
}
您可以嘗試另一個有用的函數,該函數名為sleep();。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.