C语言多文件编程
2014-11-30 22:40
274 查看
fun.c
fun.h
main.c
对上面的每个 .c 文件都进行编译,然后链接并运行:
The first function!
The second function!
The third function!
#include <stdio.h> int fun1(){ printf("The first function!\n"); return 0; } int fun2(){ printf("The second function!\n"); return 0; } int fun3(){ printf("The third function!\n"); return 0; }
fun.h
#ifndef _FUN_H #define _FUN_H extern int fun1(void); extern int fun2(void); extern int fun3(void); #endif
main.c
#include <stdio.h> #include <stdlib.h> #include "fun.h" int main(){ fun1(); fun2(); fun3(); system("pause"); return 0; }
对上面的每个 .c 文件都进行编译,然后链接并运行:
The first function!
The second function!
The third function!
相关文章推荐
- Unix下C语言----低级文件编程
- Linux Unicode 编程--C语言如何使用/生成UTF-8编码格式的文件
- C语言编程中从密码文件获取数据的函数总结
- C语言编程获取PE文件导入函数
- C语言--- 字符串数组 、 预处理器和预处理指令 、 多文件编程 、 结构体
- C语言ADT(抽象数据类型编程) (含Demo演示文件)
- Linux下的C语言编程——文件操作
- C语言简单的多文件编程【注意事项/易错点】 文章仍在编辑中
- 16-C语言模块化编程(多文件编程)
- CentOS7.0下用c语言编程输出mysql5.7数据库某张表中的数据到txt文件中
- 菜鸟攻略——C语言多文件编程初探(一)
- c语言编程之文件监视器
- Linux下So文件的加载(C语言编程)
- [FileIO]C语言中流与文件操作编程学习
- 02 vim 配置文件的简单修改方法(满足C语言编程需求)
- Unix下C语言----目录文件编程
- UNIX-LINUX C语言编程->实验室->多次打开文件实验
- 详解keil采用C语言模块化编程时全局变量、结构体的定义、声明以及头文件包含的处理方法!
- C语言(7) 模块化编程及多文件开发注意事项
- c语言编程文件和函数说明模板