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
What is %s and %d in c?
What is volatile variable in c with example?
Why cant I open a file by its explicit path?
How can I use a preprocessorif expression to ?
What is variable declaration and definition in c?
What is extern variable in c with example?
How are strings stored in c?
why return type of main is not necessary in linux
What is header file definition?
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is function pointer c?
The difference between printf and fprintf is ?
What is a pointer in c?
What is a shell structure examples?