Language C Tutorial

Extern definition is used when referencing a function or variable defined outside.

// Program in file externa1.c
#include                 
#include 
extern int i;                     
main()
{
    i =0;                         
    printf("value of i %d\n",i);
}

// Program in file f1.cpp
int i =7;