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

What is page thrashing?

651


What are nested functions in c?

564


What is static and auto variables in c?

566


What does double pointer mean in c?

576


Explain modulus operator.

595






How can I access an I o board directly?

623


What is typedef struct in c?

584


What is .obj file in c?

648


What is the code in while loop that returns the output of given code?

1315


What are the different types of data structures in c?

601


What is line in c preprocessor?

613


What is selection sort in c?

609


What are the types of arrays in c?

621


What is the use of printf() and scanf() functions?

630


How do you determine whether to use a stream function or a low-level function?

647