求给一下在ubuntu13.04中用vim编写一个hellow world的c语言程序并执行编写的c语言的详细步骤成功运行给分

2025-02-25 11:17:21
推荐回答(2个)
回答1:

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程序)
完毕

回答2:

vim hello.c
按i进入编辑模式
.....(写代码)
按esc退出编辑模式
按shift+:
输入q,回车,退出vim
gcc hello.c
./a.out