- 博客(1)
- 收藏
- 关注
原创 c++中extern用法-个人理解
1.在头文件中外部声明 例 在test.h中 extern bool flag; 在test.cpp中外部定义 #include <test.h> bool flag = true; 在其他文件夹中调用方式则为 在test1.cpp中外部定义 #include <test.h> bool flag = true; 此时,变量flag则为这三个文件中相同的变量,可在函数中重复使用或者赋值 参考https://blog.csdn.net/quzhongxin/article/det
2020-10-29 21:24:22 945
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人