What is meant by global static? why we have to use static
variable instead of Global variable

Answer Posted / abdur rab

Static remains throughout the program, however its scope is
limited to that file alone. If a program consists of
multiple files, you want a variable to be seen by the
entire file and do not want that variable to be seen by the
other files, then mark is as static

static int a;

as a global variable

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are preprocessor directives?

629


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

645


Add Two Numbers Without Using the Addition Operator

355


How can I read data from data files with particular formats?

605


Why c is a procedural language?

584






Without Computer networks, Computers will be half the use. Comment.

1877


find the sum of two matrices and WAP for it.

632


What is chain pointer in c?

603


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

651


What are the advantages of Macro over function?

1206


What is array of structure in c?

594


what is the significance of static storage class specifier?

1665


What happens if a header file is included twice?

598


How to write a code for reverse of string without using string functions?

1580


How do shell structures work?

569