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

Are iterators pointers?

683


What is the benefit of encapsulation?

600


What happens when the extern "c" char func (char*,waste) executes?

642


Which c++ operator cannot overload?

560


What are structs in c++?

604






Is C++ case sensitive a) False b) Depends on implementation c) True

624


How do you print a string on the printer?

586


Explain how a pointer to function can be declared in C++?

584


Explain how to initialize a const member data.

604


Explain binary search.

582


What is the difference between c++ and turbo c++?

599


Is map thread safe c++?

640


what is multi-threading in C++?

621


What is the use of vtable?

676


How do you save a c++ program?

567