1 header.h文件
2
3 #ifndef HEADER_H
4 #define HEADER_H
5
6 unsigned long returnFactorial(unsigned short num);
7 static const unsigned short headerNum = 5;//定义静态恒定值的全局变量
8
9 #endif
10
11 thatpp文件:
12
13 #include "header.h"
14 unsigned short thatNum = 8;//定义全局变量
15 bool printMe = true;//定义全局变量
16
17 unsigned long returnFactorial(unsigned short num)
18
25 if(printMe)
26
29 else
30
33 }
34
35 thispp文件:
36
37 #include "header.h"
38 #include "iostream"
39 using namespace std;
40 extern unsigned short thatNum;//声明全局变量
41 static bool printMe = false;//定义静态全局变量
42 int main()
43
52 return 0;
53 }
上一篇:Python基础入门学习笔记 005 闲聊之Python的数据类型
下一篇:Python基础入门学习笔记 003 小插曲之变量和字符串









