what is diff between localstatic and globalstatis variable
possible 2 use in another file...?

Answer Posted / abdur rab

Local Static
============
The scope of the variable is only within the function where
it is declared, throughout the program. ie the value is
preserved until the end of the program.


Global Static
=============
The scope of the variable is only within the file where it
is declared, throughout the program. ie the value is
preserved until the end of the program.

Global Static variables are not visible outside the files
where they are declared.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we assign integer value to char in c?

617


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1497


What is New modifiers?

670


What do you mean by Recursion Function?

631


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

725






Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

690


What is a buffer in c?

575


What is the difference between arrays and pointers?

636


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

731


What is meant by initialization and how we initialize a variable?

587


Do pointers store the address of value or the actual value of a variable?

610


How a string is stored in c?

589


Tell me about low level programming languages.

644


Which built-in library function can be used to match a patter from the string?

747


Which header file is essential for using strcmp function?

945