Here is some code I found that uses extern. This is in a file called main.h, but it is all redeclared in main.cpp, and I am not sure what the purpose of the extern keyword is.
Code:extern CCamera g_Camera; // This will be our global camera data extern bool g_bFullScreen; // Set full screen as default extern HWND g_hWnd; // This is the handle for the window extern RECT g_rRect; // This holds the window dimensions extern HDC g_hDC; // General HDC - (handle to device context) extern HGLRC g_hRC; // General OpenGL_DC - Our Rendering Context for OpenGL extern HINSTANCE g_hInstance;