const variables in multiple file sharing, how to verify under two different ways, whether the compiler will create multiple copies in multiple files

Const variables for multiple file sharing, when we do not want the compiler to generate a separate file for each variable, but as a great amount of objects, define one, and using multiple statement.

The solution is, for const variables, whether declared or definitions are added extern keyword.

 

Question: how before the actual validation definitions plus extern, or as much as the amount of objects without extern defined above, in both cases, whether the compiler generates multiple independent variables.

Guess you like

Origin www.cnblogs.com/azbane/p/11273274.html