terminal或是shell中
任意目录下
vim hello.c
i(或者 a进入编辑界面)
#include
int main(void){printf("hello\n");return 0;}
ESC(返回命令界面)
:wq(保存退出)
gcc -o hello.c hello(简单的进行编译,输出为hello可执行文件)
./hello(打开hello程序)
完毕
vim hello.c
按i进入编辑模式
.....(写代码)
按esc退出编辑模式
按shift+:
输入q,回车,退出vim
gcc hello.c
./a.out