wangzhaofang

新建并执行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编译

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-07-12
  • 2021-10-27
  • 2021-11-02
  • 2021-12-16
猜你喜欢
  • 2021-08-07
  • 2021-11-05
  • 2021-12-09
  • 2021-06-22
  • 2021-10-16
  • 2021-10-21
  • 2022-01-27
相关资源
相似解决方案