const对象的全局访问

      非const的变量,默认为 extern ,可以在其他文件中访问
      而要使const变量能够在其他文件中访问,必须显式指定它为 extern ;

      //file_1.cpp
      extern const int CONST_SIZE = 10;
      //file_2.cpp
      extern const int CONST_SIZE;
      int i = CONST_SIZE;
原文地址:https://www.cnblogs.com/sevenyuan/p/1560358.html