Hai,
I am jeyshree.W ill anyone please explain me when is the memory allocated for gloabal variable in the following snippets?
#include<stdio. h>
#include<conio. h>
extern int a;
main()
{
printf("%d",a) ;
getch();
}
int a=10;
OUTPUT:
10
and another one:
#include<stdio. h>
#include<conio. h>
extern int a=10;
main()
{
printf("%d",a) ;
getch();
}
OUTPUT:
10
Please explain .Thanks in advance
I am jeyshree.W ill anyone please explain me when is the memory allocated for gloabal variable in the following snippets?
#include<stdio. h>
#include<conio. h>
extern int a;
main()
{
printf("%d",a) ;
getch();
}
int a=10;
OUTPUT:
10
and another one:
#include<stdio. h>
#include<conio. h>
extern int a=10;
main()
{
printf("%d",a) ;
getch();
}
OUTPUT:
10
Please explain .Thanks in advance
Comment