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

What is a dynamic array in c?

797


what is the function of pragma directive in c?

872


what is the role you expect in software industry?

1869


How can I read/write structures from/to data files?

739


What is a pointer and how it is initialized?

809


define string ?

853


What is the data segment that is followed by c?

819


How main function is called in c?

817


What is structure packing in c?

811


which is an algorithm for sorting in a growing Lexicographic order

1574


What does *p++ do? What does it point to?

808


What are conditional operators in C?

808


What is the difference between int main and void main in c?

814


What is the difference between union and anonymous union?

1038


Explain output of printf("Hello World"-'A'+'B'); ?

1168