What is the scope of static variables in c language?
Answer / 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 |
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
Differentiate between Macro and ordinary definition.
What does c mean?
What is assert and when would I use it?
What are run-time errors?
What are the types of operators in c?
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?
void main() { int a=1; printf("%d %d %d",a,++a,a++); } the output is supposed to be 1 2 2....but it is 3 3 1 this is due to calling conventions of C. if anyone can explain me how it happens?
f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=?
write a program for 7*8 = 56 ? without using * multiply operator ? output = 56
In the following code segment what will be the result of the function, value of x , value of y { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); } a) same, MAXINT, -1 b) not same, MAXINT, -MAXINT c) same , MAXUNIT, -1 d) same, MAXUNIT, MAXUNIT e) not same, MAXINT, MAXUNIT
what are two categories of clint-server application development ?