#include#include #include int main(void) { int status; //存放system函数的返回值 printf("system函数调用date命令.\n"); status = system("date"); //调用date命令获得时间相关信息 if(status <0) //如果status小于0,表明调用出错 { perror("system函数调用date出现错误.\n"); //调用出错 exit(0); } printf("system函数的退出值是%d \n",status); //输出system函数的返回值 printf("system函数调用nosuchcommand命令.\n"); if((status=system("nosuchcommand"))<0) //如果status为nosuchcommand的返回值 { printf("system函数调用nosuchcommand错误"); exit(0); } printf("system函数的退出值是%d \n",status); //打印对应状态 printf("system函数调用who命令\n"); if((status=system("who; exit 44"))<0) //调用who函数 { perror("system函数调用who出现错误"); //打印错误信息 exit(0); } printf("system函数的退出值是%d\n",status); //打印退出状态 exit(0); }
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款