[英]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.