⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test9_9.txt

📁 Linux下的C语言编程
💻 TXT
字号:
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    	int status;

    	if((status=system(NULL))<0)
    	{
        	printf("system error! \n");
        	exit(0);
    	}
    	printf("exit status=%d\n", status);
	
    	if((status=system("data"))<0)
    	{
        	printf("system error! \n");
        	exit(0);
    	}
    	printf("exit status=%d\n", status);

    	if((status=system("invalidcommand"))<0)
    	{
        	printf("system error! \n");
        	exit(0);
    	}
	printf("exit status=%d.\n", status);

	if((status=system("who;exit 44"))<0)
	{
        	printf("system error! \n");
        	exit(0);
	}
	printf("exit status=%d. \n", status);

	exit(0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -