Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / guest

localstatic belong to that only that function .
globalestatic belong 2whole file. not possible.

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More C Interview Questions

Given an array A[n+m] of n+m numbers, where A[1] ... A[n] is sorted and A[n+1] ... A[n+m] is sorted. Design a linear time algorithm to obtain A[1...n+m] sorted using only O(1) extra space. Time Complexity of your algorithm should be O(n) and Space Complexity O(1).

0 Answers  


can v write main() { main(); } Is it true?

6 Answers  


pgm to find middle element of linklist(in efficent manner)

4 Answers   Huawei,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

2 Answers   HCL, IBM, Satyam, Vimal, Vimukti Technologies,


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

0 Answers  






#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

0 Answers   Wilco,


What is #error and use of it?

0 Answers  


What is a lvalue

0 Answers   Global Logic,


how to write a prog in c to convert decimal number into binary by using recursen function,

1 Answers  


What is the usage of the pointer in c?

0 Answers  


How can I manipulate individual bits?

0 Answers  


Difference between malloc() and calloc() function?

0 Answers  






Categories