标签:程序 ted tst else ring amp == main return
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>#include <unistd.h>
int main(int argc, char *argv[])
{
int status;
pid_t pid;pid = fork(); if (0 == pid) { exit(atoi(argv[1])); } else { wait(&status); printf("status = %d\n", status); if (WIFEXITED(status)) { printf("WEXITSTATUS(status)=%d\n", WEXITSTATUS(status)); } } return 0;
}
该程序运行结果
标签:程序 ted tst else ring amp == main return
原文地址:https://www.cnblogs.com/huyang892/p/10986385.html