Extern definition is used when referencing a function or variable defined outside.
// Program in file externa1.c #include <stdio.h> #include <c:\f1.cpp> extern int i; main() { i =0; printf("value of i %d\n",i); }
// Program in file f1.cpp int i =7;