What is the difference between static and global variables?



What is the difference between static and global variables?..

Answer / kush joshi

static variable only can access within a function where
these declared, but the global variables access any where in
the program.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More C Interview Questions

main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); }

2 Answers   Vector, Vector India,


Why is c called c not d or e?

0 Answers  


write a c program to add two integer numbers without using arithmetic operator +

13 Answers   Value Labs,


Differentiate between static and dynamic modeling.

0 Answers   Wipro,


main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....

2 Answers  






what is output? main() { #define SQR(x) x++ * ++x int i = 3; printf(" %d %d ",SQR(i),i * SQR(i)); } a)9 27 b)35 60 c)20 60 d)15 175

5 Answers   Wipro,


main() { float f1=10.5; double db1=10.5 if(f1==db1) printf("a"); else printf("b") }

2 Answers   CSC,


What is difference between union and structure in c?

0 Answers  


If I have a char * variable pointing to the name of a function ..

0 Answers  


Write a C program to fill a rectangle using window scrolling

1 Answers  


Are the variables argc and argv are local to main?

0 Answers   TISL,


how to use virual function in real time example

1 Answers   CTS, Wipro,


Categories