使用系统命令pause
运用到程序里例如:
#include
#include
int main()
{
printf("hello, world!\n");
system("pause");
}
也就是说在你的程序最后加上system("pause")即可.
注意必须包含头文件 stdlib.h
在main的时候加个getchar();就行了。
如果是VC,可以有程序最后加 system("pause");(Linux环境不可用)
也可以加getchar();或getch();
最简单的方法 :在main的最后加个getchar();就行了。
按键盘锁定键ScrollLock,然后自己找就行了。