Ubuntu中敲写c语言步骤

1.进入Ubuntu界面

1.1按快捷键 Ctrl + Alt + T;

1.2 安装vim:输入 sudo apt-get install vim;

1.3 安装gcc:输入 sudo apt-get install g++。

2.创建文件,敲写代码。

2.1 新建文件名为test.c的源文件:输入vim test.c;

2.2 按i 进入insert模式(即编辑输入模式)

2.3若想要行号,Esc回到normal模式,按:set nu!即可

2.4 输入完成后,Esc 回到normal模式,按:wq 保存退出vim。

3.编译  gcc -o test test.c  

4.运行程序  ./test

原文地址:https://www.cnblogs.com/zengsf/p/7221376.html