目前用VMWARE 灌了fedora
起因是有課程 老師叫我們在linux系統下
跑一個程式
程式如下
int main()
{
pid_t pid;
/* fork another process */
pid = fork();
if (pid < 0) { /* error occurred */
fprintf(stderr, "Fork Failed");
exit(-1);
}
else if (pid == 0) { /* child process */
execlp("/bin/ls", "ls", NULL);
}
else { /* parent process */
/* parent will wait for the child to complete */
wait (NULL);
printf ("Child Complete");
exit(0);
}
}
但是程式要寫在哪邊 用終端機去compiler結果呢
我想好好學習linux系統
請問有大大可以指點一下嗎? 感恩.
--
起因是有課程 老師叫我們在linux系統下
跑一個程式
程式如下
int main()
{
pid_t pid;
/* fork another process */
pid = fork();
if (pid < 0) { /* error occurred */
fprintf(stderr, "Fork Failed");
exit(-1);
}
else if (pid == 0) { /* child process */
execlp("/bin/ls", "ls", NULL);
}
else { /* parent process */
/* parent will wait for the child to complete */
wait (NULL);
printf ("Child Complete");
exit(0);
}
}
但是程式要寫在哪邊 用終端機去compiler結果呢
我想好好學習linux系統
請問有大大可以指點一下嗎? 感恩.
--
All Comments