Difference between static global and global?

Answer Posted / ravi.g

local static variable and global variable both are same
since both can be accessed from all the functions in the
same file in which they declared.

Global variable has the file scope since it can be accessed
from other files also by using extern keyword.

Local static vaeriables have no file scope since they can
not be accessed from other files by any means.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain explicit container.

629


How does list r; differs from list r();?

685


What are iterators in c++?

587


What is a container class?

613


What is late binding c++?

536






When is dynamic checking necessary?

593


What are pointer-to-members? Explain.

622


What is the best c c++ compiler for windows?

556


What is a class definition?

609


What is bubble sort c++?

568


write a programme to get a character and thier ASCII value

2592


What are the differences between the function prototype and the function defi-nition?

605


What is pure virtual function?

621


Write about a nested class and mention its use?

621


What is a terminating character in c++?

756