Original Post
I was going through the Pixie (renderman compliant renderer) source code. In the ri.h header file, which gets sourced by the file that contains function main(), all of the variables are declared as extern type variables. So the file that contains main is like this: #include "ri/ri.h" int main(int argc, char* argv[]) { code here; } ri.h looks like this: #ifndef RI_H #define RI_H 1 typedef char *RtToken; extern RtToken RI_FRAMEBUFFER, RI_FILE; #endif /* RI_H */ It looks like extern is being used to declare the variable. I thought that you only used extern to refer to the already-declared external variable, which you would just declare normally. For example: int test; int main(void) { extern int test; test = 1; } What happens when you declare a variable for the first time with extern?