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
What is uint8 in c?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
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 the use of volatile?
Why can’t constant values be used to define an array’s initial size?
What is an operator?
What are near, far and huge pointers?
What are control structures? What are the different types?
Why is c still so popular?
Differentiate between the expression “++a” and “a++”?
What are the advantages and disadvantages of c language?
explain what is a newline escape sequence?
code for quick sort?
How does normalization of huge pointer works?
What is structure data type in c?