what is the difference between global variable & static
variable declared out side all the function in the file.

Answer Posted / vishnu

Both the variables are stored in data segment but difference
is in accessing the variable. Global variables can be
accessed though out the project (if multiple files exists)
whereas static variable accessed within the file where its
declared.

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do pointers need to be initialized?

556


What is hash table in c?

562


What is function prototype in c language?

606


What is structure and union in c?

594


Where are local variables stored in c?

566






Write a c program to build a heap method using Pointer to function and pointer to structure ?

4169


What is header file in c?

597


Explain what are the advantages and disadvantages of a heap?

590


Can you tell me how to check whether a linked list is circular?

757


What is a null pointer in c?

587


Explain void pointer?

585


Explain high-order and low-order bytes.

659


What is the value of uninitialized variable in c?

563


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

607


What do you understand by friend-functions? How are they used?

639