linux中开发c语言程序

新建并执行c语言

(1)vim test.c  新建c语言源文件并打开,编写代码(i 进入插入模式)

(2)gcc test.c -o test.out  编译test.c文件成test.out文件

(3)./test.out  运行test.out文件

示例:

#include <stdio.h>

int main(int argv,char* argc[])
{
  printf("the argv is %d\n",argv);
  int i;
  for(i=0;i<argv;i++){
    printf("argc[%d]is %s\n",i,argc[i]);
  }
  return 0;
}

 

对于多个文件采用:Makefile编译

posted @ 2018-01-30 11:33  wangzhaofang  阅读(200)  评论(0编辑  收藏  举报