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...?..

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...?..

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

 Is This Answer Correct ? 6 Yes 1 No

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).

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

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

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)

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

#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); }

What is #error and use of it?

What is a lvalue

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

What is the usage of the pointer in c?

How can I manipulate individual bits?

Difference between malloc() and calloc() function?

Categories