1,033 views
1 votes
1 votes
Why am i not getting any error while executing the following statements?

int x=20;

int z=x;//error expected but not coming

int main()
{
int y=10;
static int temp=y; //Error expected but not coming
temp=99;//Error expected but not coming
 getch();
}

1 Answer

0 votes
0 votes
static variable occupies memory at compile time but you r assigning the value which is created at run time

Related questions

2 votes
2 votes
1 answer
1
0 votes
0 votes
0 answers
2
Kapil asked Sep 16, 2016
1,003 views
Consider 2 Program initializations P and Q .Are both the initializations equivalent ?P:: x:=1; y:=1; z:=1; u:=0Q:: x, y, z, u := 1, 1, 1, 0;
0 votes
0 votes
2 answers
3
radha gogia asked Jul 29, 2015
590 views
when I write this statement int i=1,2,3 then why is this an error , how does comma acts here as a separator ,while in this casei=1,2,3 it acts an operator