linuxC编程介绍

第一步:写完程序

/first.c/
#include <stdio.h>
int main()
{
     printf("hello,welcome to the LinuxC!\n");
     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

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

 

posted @ 2018-07-26 20:36  小猪利琦  阅读(209)  评论(0编辑  收藏  举报