External references : External references « Language « C Tutorial






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;








1.18.External references
1.18.1.External references