多语言展示
当前在线:845今日阅读:176今日分享:34

linux下写第一个c程序hello word

在linux写第一个程序hello word,编译运行在终端输出hello word
工具/原料

linux系统

方法/步骤
1

在linux系统下打开终端,在home目录下(可以在自己的目录)新建文件hello.c:touch hello.c回车,在vi下打开hello.c:vi hello.c回车

2

在vi下输写代码(vi操作请查阅相关资料),代码写完后wq保存并退出

3

gcc编译hello.c:gcc hello.c -o hello回车,运行hello:./hello回车,终端就会输出hello word

推荐信息