what is the diff b/w static and non static variables in C.
Give some examples plz.
Answer Posted / anil kumar
Static variables are used for internal contextual
communication purpose.
non static variables are not used for contextual
communication
for that please go through the below code:
static int i=10;
int main()
{
int x=20;
Printf(“%d %d”,x, i);
Fun();
return 0;
}
Void Fun()
{
Printf(“%d”, i);
}
In the above code “i” is the static variable and “x “is the
local variable
| Is This Answer Correct ? | 22 Yes | 7 No |
Post New Answer View All Answers
Can you please explain the difference between exit() and _exit() function?
Explain what is meant by 'bit masking'?
What is meant by preprocessor in c?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
how many key words availabel in c a) 28 b) 31 c) 32
What is #include cctype?
why wipro wase
How can I copy just a portion of a string?
Should I learn data structures in c or python?
Explain how do you declare an array that will hold more than 64kb of data?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
Is flag a keyword in c?
What is size of union in c?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
I need a sort of an approximate strcmp routine?