为什么在头文件里已经声明了全局变量,在main里面还是显示未声明?
还要在 6.cpp 那里加上 extern int i 啊,不然只有 m.h 和 7.cpp 可见
6.cpp
extern int i
m.h
7.cpp