1.使用vi/vim进行编写代码并保存为hello_world.c.如下:
/* This is my first C program*/
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
}
2.使用gcc进行编译
gcc hello_world.c -o hello_world
3.像执行shell脚本一样执行
./hello_world
本文详细介绍了如何使用vi/vim编辑器编写C语言代码,并通过gcc进行编译,最终执行程序。涵盖了从创建、编译到运行C语言程序的全过程,适合初学者快速上手。
1.使用vi/vim进行编写代码并保存为hello_world.c.如下:
/* This is my first C program*/
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
}
2.使用gcc进行编译
gcc hello_world.c -o hello_world
3.像执行shell脚本一样执行
./hello_world

被折叠的 条评论
为什么被折叠?