1// extern basically defines a global variable.
2
3//fileA.cpp
4int i = 42; // declaration and definition
5
6//fileB.cpp
7extern int i; // declaration only. same as i in FileA
8
9//fileC.cpp
10extern int i; // declaration only. same as i in FileA
11
12//fileD.cpp
13int i = 43; // LNK2005! 'i' already has a definition.
14extern int i = 43; // same error (extern is ignored on definitions)
15