Difference between static global and global?

Answer Posted / sandeep gautham

a program can be spread across two or more files...
so, a global variable can be accessed by all the files..
where as, a static global variable can be accessed only by
the file in which it is declared...static means permanent
and hence the value in static global variable is shared by
all the functions in that file...

Is This Answer Correct ?    35 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class be static in c++?

561


How are virtual functions implemented in c++?

594


What are the extraction and insertion operators in c++?

557


What is problem with overriding functions?

601


How to tokenize a string in c++?

600






Explain about Garbage Collector?

642


Can class objects be passed as function arguments?

597


What is array in c++ pdf?

548


What is data abstraction? How is it different from data encapsulation?

525


How const int *ourpointer differs from int const *ourpointer?

601


Can user-defined object be declared as static data member of another class?

544


What is the need of a destructor? Explain with the help of an example.

554


What is the difference between a declaration and a definition?

577


What is recursion?

652


What are guid? Why does com need guids?

566