Variables, functions, classes, definitions, and implementation of implementation (increasing)

xiaoxiao2021-03-06  40

Extern Int i; indicating that the i here is just a declaration, otherwise I will see the definition for global variables, it is possible to violate the definition method (ODR) extern foo (); turn the function "in other local definitions" becomes significant The same name constant can appear in different compilation units, and the value can be different! //------foo.c------------------------------ / /--------bar.c---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Export Foo () {}; export template Foo (t t) {}; tells the compiler that this definition may be needed in other compilers. Global objects and non-inline functions can only have a definition, while the inline function can have multiple identical definitions (the actual situation is possible, in fact, the inner function is the same, just in the current compilation unit. Valid. In fact, other compilation even if this function is declared, but does not have its definition, it will not find this function when it is connected.) Function declaration and class definition is visible to compile, and the (member) function is a connection Time needs.

转载请注明原文地址:https://www.9cbs.com/read-58579.html

New Post(0)