// file_1.cc // defines and initializes a const that is accessible to other files extern const int bufSize = fcn(); // file_2.cc extern const int bufSize; // uses bufSizefrom file_1 //uses bufSizedefined infile_1 for (int index = 0; index != bufSize; ++index) // ... 在声明和定义处都需要加extern关键字