/* File one.cpp */ #include "two.h" #include int a = 0; int main() { test(); // Prints 22 std::cout << a << std::endl; return 0; } /* File two.h */ void test(void); /* File two.cpp */ // Says the a we use in this file is the same one as in one.cpp extern int a; void test(void) { a = 22; }