← 回到文章列表

ubuntu最简单编译C语言的方法

在主文件夹新建一个文件 命名为"hello.c" 右击文件 选择用Gedit打开 在其中输入 #include"stdio.h" main() { printf("Hello World! \n"); } 保存 打开命令窗口 输入"gcc hello.c"使用gcc编译hello…

在主文件夹新建一个文件
命名为"hello.c" nextpage
[媒体不可用]
右击文件
选择用Gedit打开
[媒体不可用]
在其中输入\


#include"stdio.h"
main()
{
printf(“Hello World! \n”);
}\


[媒体不可用]
保存
nextpage
打开命令窗口
输入"gcc hello.c"使用gcc编译hello.c
编译成功之后可以在hello.c文件旁边找到a.out文件
[媒体不可用]
打开a.out文件就可以看到传说中的"Hello World!“拉~~~~
[媒体不可用]

写下来,是为了下次少走一点弯路。

在这里找找

输入关键词,找一篇过去的记录。