proc() {
static i=10;
printf("%d",i);
}
If this proc() is called second time, what is the output?
Answer Posted / sujith
I dont know how can it be 11 next time.
I agree that static variables are assigned only once, and
allocation is happening to the data segment, but it doesnt
mean that is going to change the value on its own, until u
do that manually.
U call this program for n times, the answer is going to be 10.
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
What is 2c dna?
Explain what is the difference between null and nul?
what are the facialities provided by you after the selection of the student.
What does it mean when the linker says that _end is undefined?
In c programming language, how many parameters can be passed to a function ?
What is the difference between malloc calloc and realloc in c?
Explain what are reserved words?
What is the use of extern in c?
What Is The Difference Between Null And Void Pointer?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Which header file is used for clrscr?
Are the expressions * ptr ++ and ++ * ptr same?
How old is c programming language?