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

What are the restrictions apply to constructors and destructors?

641


What are references in c++? What is a local reference?

571


Define anonymous class.

621


Can java be faster than c++?

666


What are pointer-to-members? Explain.

624






Differentiate between realloc() and free().

590


What is const in c++?

594


What does new return if there is insufficient memory to make your new object?

580


Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).

615


what is scupper?

1890


Write about a nested class and mention its use?

623


What is c++ best used for?

563


What is #include iostream h in c++?

607


What do you mean by friend class & friend function in c++?

620


Explain the benefits of proper inheritance.

636