|
|
头文件一般包括:
类型声明,如 enum MYCOLOR{ ...// };
函数声明, 如 extern int f( int );
内联函数定义, 如 inline char f( char p ) { return '0'; };
常量定义, 如 const float pi=3.1415926;
数据声明,如 extern int m; extern int a[];
枚举, 如 enum BOOLEN { false, true; };
包含指令(可嵌套), 如 # include <iostream.h>
宏定义, 如 #define MAXSIZE 1024
注释,如 //.......
----------------------------------
但是头文件中不宜包含:
一般函数定义, 如 char f() { return 'a'; };
数据定义, 如 int a; int b[5];
数据常量聚集定义,如 const int c[] = { 1, 2, 3 }; |
|