|
楼主 |
发表于 2005-6-25 12:20:40
|
显示全部楼层
zhy2111314, #include <stdio.h>
#include <unistd.h>
#include <time.h>
int main(int argc,char *argv)
{int i,pid;
pid=fork();
time_t t;
time(&t);
if(pid>0)
printf("today's date and time:%s\n",ctime(&t));
wait()
else
{if(pid=0)
for(i>0,i<4,i++)
printf("today's date and time:%s\n",ctime(&t));
exit(1)
}
} |
|