What is the scope of static variables in c language?
Answer Posted / dhanshri chabukswar
in c language the scope of a static variable depends on where it is declared
void func(){
static int x=0;
x++;
printf("%d",x);
}
scope - is x
out put- 123 if you call func()three times
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is the advantage of using #define to declare a constant?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is use of null pointer in c?
What is build process in c?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
How can I write a function that takes a format string and a variable number of arguments?
How do I swap bytes?
Why n++ execute faster than n+1 ?
how to capitalise first letter of each word in a given string?
Explain how can type-insensitive macros be created?
What are linker error?
Explain how are 16- and 32-bit numbers stored?
Explain spaghetti programming?