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

Explain two-dimensional array.

637


Explain bit masking in c?

646


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

1752


What is the significance of an algorithm to C programming?

604


Tell me the use of bit field in c language?

636






In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

989


What does stand for?

611


difference between native and cross compilers

1684


For what purpose null pointer used?

615


Explain what does the format %10.2 mean when included in a printf statement?

793


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15067


What is void c?

579


Does c have enums?

610


What is the difference between struct and union in C?

582


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

919