在终端下依次输入以下两个命令(注意:要是root用户,否则没有权限)
yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake
yum -y install wget httpd-tools vim
例子:helloworld程序:输出helloworld
(1)创建名为helloworld.c文件
vim helloworld.c
(2)进入文件之后,按‘i‘建后开始编写代码:
#include <stdio.h> int main() { printf("hello world!\n"); return 0; }
(3)保存退出,按"ESC"这个键,然后输入wq!
(4)退出之后在终端输入:编译helloworld.c命令
gcc helloworld.c
执行命令:
./a.out
(5)最后的结果:
原文:https://www.cnblogs.com/Aiahtwo/p/12495276.html