關於在系統下 compiler程式的方法 - Linux

Table of Contents

目前用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系統

請問有大大可以指點一下嗎? 感恩.

--

All Comments

Megan avatarMegan2010-10-02
google: linux editor compiler
Kyle avatarKyle2010-10-06
用vim寫用cc編譯
Callum avatarCallum2010-10-10
鳥哥網站
Blanche avatarBlanche2010-10-14
是用 "compiler" 去 "compile" 程式
Valerie avatarValerie2010-10-17
在虛擬機下編譯不是很慢嗎,在除錯時很讓人抓狂
Quanna avatarQuanna2010-10-20
可是這樣應該要include一些東西說
Isabella avatarIsabella2010-10-22
這種小程式編譯應該不用花到3秒鐘才是
Ophelia avatarOphelia2010-10-24
原po確實有漏一些include, 看到錯誤再去修正吧 XD
Harry avatarHarry2010-10-28
其實在vmware編譯不會特別慢,以前修課的時候意外發現
用cygwin編譯還比在vmware上編譯來得久,不知道原因
Lily avatarLily2010-11-02
缺的函式貼去Google查要include什麼檔案吧.....
Elvira avatarElvira2010-11-04
我是已經執行出結果了。
Agnes avatarAgnes2010-11-06
OS嗎?XD