ubuntu 命令之vi

 一: vi hello.c     进入vi

 二: :w hello.c    命名为filename,并且保存

 三: :wq            退出vi

输入代码,如图所示

 

最后通过命令自动帮助你缩进

 indent -st hello.c

效果还不错,下一步我们试着让gcc环境我帮我解释一下,步骤还挺顺利的。

出现了异常,请看

哇一堆错误,我真够马虎的!!! 

 简单的代码,上面有严重的错误。

#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,j;
for (i=0,j=10;i<j;i++)
{
printf("hello,linux world\n");
exit(0);
}
}
chenli@chenli-desktop:~$

编译成功 the end!

原文地址:https://www.cnblogs.com/chenli0513/p/1882027.html