一、编写hello wolrd
1.新建文件夹:mkdir hw.
2.打开文件夹:cd hw.
3.创建hello.c文件夹:vi hello.c
4编写hello.c
5.将hello.c编译可运行文件:gcc hello.c -o hello
6.运行:./hello.
二、用gcc命令方式编译:
1编写一个main.c程序
2.编写sub.c:
3.编译main.c,运行:
三用makefile方式编写:
1.安装make:
apt-get install make
2.用vi编写准程序和上面main.c,sub.c一样
3.用gcc命令把main.c和sub.c文件生成main.o和sub.o
4.创建并用个getdit编译makefile文件
5用make命令运行makefile并出结果。
四、小结
了解怎么创建文件,编写文件,编译文件,运行文件