Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

what is the usage of extern in c

#include <stdio.h>
extern int x = 32;
int b = 8;
int main() {
   auto int a = 28;
   extern int b;
   printf("The value of auto variable : %d
", a);
   printf("The value of extern variables x and b : %d,%d
",x,b);
   x = 15;
   printf("The value of modified extern variable x : %d
",x);
   return 0;
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #usage #extern
ADD COMMENT
Topic
Name
3+4 =