linuxC编程介绍

第一步:写完程序

/first.c/
#include <stdio.h>
int main()
{
     printf("hello,welcome to the LinuxC!
");
     return 0;
} 

第二步:编译

[root@centOS ~]# gcc first.c -o first
[root@centOS ~]# ./first
hello,welcome to the LinuxC!
gcc编译格式主要有如下三种:
  • gcc C源文件 -o 目标文件名;
  • gcc -o 目标文件名 C源文件;
  • gcc C源文件:

最后一种情况中,目标文件默认为:a.out

(未完,待续............)

原文地址:https://www.cnblogs.com/happying30/p/9374274.html