15.StorageClass FAQ
15.StorageClass FAQ
3. 4.
Compile the above two files using Study nm command , using $man nm
gcc main.c sum.c observe the output of $nm a.out
} }
inc.c inc.c
--------------------------------- ---------------------------------
void inc(void) void inc(void)
{ {
extern int x;// also try without extern. extern int x;
++x; ++x;
} }
11. 12.
int x=10; int main()
int main() {
{ int a=1;
int y=x; switch(a)
int z=y; { int b=5;
printf(“%d %d %d”,x,y,z); case 1: printf(“b=%d\n”,b);
}
} }
13. //main.c 14. //inc.c
int i;
static void inc(void) void inc(void)
{ {
i++; int i;
} ++i;
int main() }
{
inc(); Note: compile along with program in 13th. as
inc(); $ gcc main.c inc.c
printf(“%d”, i); Also observe the a.out content.
} $ nm a.out