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
What is malloc calloc and realloc in c?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
Why should I use standard library functions instead of writing my own?
List some basic data types in c?
What is c language and why we use it?
What does s c mean on snapchat?
What does typedef struct mean?
What are the key features in c programming language?
What is file in c preprocessor?
What is getch() function?
What is wrong with this declaration?
code for find determinent of amatrix
Can you write a programmer for FACTORIAL using recursion?
What is getch c?
Where are local variables stored in c?