一.编写程序
1.创建文件
hello.c被称为源文件。
vim hello.c
2.编写代码 eg.
#include<stdio.h>
main(){
printf("Hello World\n");
}
3.编译,自动生成a.out文件
gcc hello.c
4.运行 a.out
a.out被称为可执行文件。
./a.out
二.说明
1.#include<stdio.h>被称为头文件,可以调用里面的函数。
2.main()称为主函数,是入口函数。
3.main后的()是函数的参数列表。
4.{}是函数体。
5.printf("hello world\n"); 是语句。
6.在双引号“”里的字为字符串。
7.\n是换行符。