Linux系统中头文件的使用
来源:互联网 发布:top域名管理局 编辑:程序博客网 时间:2024/05/16 19:22
文件add.h
#ifndef ADD_H_
#define ADD_H_
int add(int,int);
double add2(double,double);
#endif
文件add.c
int add(int a,int b){
return a+b;
}
double add2(double a,double b){
return a+b;
}
文件test.c
#include <stdio.h>
#include "add.h"
int main(){
int r1 = add(2,3);
double r2 = add2(3.0,2.0);
printf("r1=%d,r2=%lf\n",r1,r2);
return 0;
}
gcc test.c add.c –I <指定路径>命令一次性编译链接源文件test.c和add.c,
由于没有指定生成的文件名,所以生成可执行文件a.out。
#ifndef ADD_H_
#define ADD_H_
int add(int,int);
double add2(double,double);
#endif
文件add.c
int add(int a,int b){
return a+b;
}
double add2(double a,double b){
return a+b;
}
文件test.c
#include <stdio.h>
#include "add.h"
int main(){
int r1 = add(2,3);
double r2 = add2(3.0,2.0);
printf("r1=%d,r2=%lf\n",r1,r2);
return 0;
}
gcc test.c add.c –I <指定路径>命令一次性编译链接源文件test.c和add.c,
由于没有指定生成的文件名,所以生成可执行文件a.out。
0 0
- Linux系统中头文件的使用
- linux系统头文件
- Linux系统头文件
- linux系统头文件
- Linux系统下的头文件
- Linux系统常用头文件的说明
- Linux系统编程学习之《Linux中常见的头文件》
- linux中常用的头文件
- Linux C++中需要的头文件
- linux中头文件的位置
- linux中常用的头文件
- LINUX中添加头文件的方式
- Linux中一些头文件的作用
- Linux C++中需要的头文件
- linux中常用的头文件
- Linux中寻找头文件的方法
- linux中头文件的位置
- Linux C++中需要的头文件
- c语言排序算法源代码
- 拉普拉斯算子
- 腾讯笔试题
- Atitit.web ui 组件化 vs mvc
- this关键字
- Linux系统中头文件的使用
- 装饰者模式
- Fliter2D
- 【诸葛干货】一看就明白的爬虫入门-基础理论篇(上篇)
- 用jspdf实现html5页面下载成pdf文件
- Aliyun(阿里云)搭建WordPress
- Java_SE08-文本数据IO操作,异常处理
- Bigger is Better
- C#学习----变量和表达式