摘要: 今天写代码的时候,需要多个文件使用同一个常量(全局的常量)。于是就把常量的声明放到一个头文件里头,常量的定义放到对应的源文件里头。 声明在constant.h里 extern const int Index; 定义在constant.cpp里 const int index = 2; 在其他文件想要 阅读全文
posted @ 2022-11-03 20:57 小头痛 阅读(18) 评论(0) 推荐(0) 编辑