简单来说就是暂停的意思,一般在LINUX编程时会用到,等待接收信号,才会重新运行 。
在进行C/C++编程的时候,在运行程序查看输出效果时,会出现窗口闪一下就关闭的情况。
在C语言中一般通过添加getchar();
在C++中一般在main函数中的return之前添加system(“pause”);这样就可以看清楚输出的结果,pause会输出”press any key to continue. . .”。
system函数原型为 int system(char *command),在wind
简单分析了linux下system函数的相关内容,具体内容如下
int
__libc_system (const char *line)
{
if (line == NULL)
/* Check that we have a command processor available. It might
not be available after a chroot(), for example. */
return do_system (exit 0) == 0;
retur