Hi frnds.. please help me in solving my doubt
In the below prog
Code:
#include.......
static int x = 10;
main()
{
fun1();
sleep(1);
fun1();
fun2();
}
fun1(){
static int x = 11;
printf("%d \n", x++ );
}
fun2()
{
printf( "%d \n", x );
}
we have static var x globally initialized, and the static var with same name x is defined and modified with block scope in fun1 and the static var x being used in fun2.
Actually static variables will be stored in BSS (if uninitialized) and in Data seg (if initialized). But in the above prog where the locally defined static var x in fun1 is stored?