in one file global variable int i; is declared as static. In
another file it is extern int i=100;
Is this valid ?

Answers were Sorted based on User's Feedback



in one file global variable int i; is declared as static. In another file it is extern int i=100; ..

Answer / phani

No its invalid.A variable declared as static cannot be
changed though it is a global variable.

Is This Answer Correct ?    20 Yes 3 No

in one file global variable int i; is declared as static. In another file it is extern int i=100; ..

Answer / anil

variable/function defined static make the scope limited to
only the file in which it is defined and cannot be accessed
outside the file. Hence it is invalid

Is This Answer Correct ?    6 Yes 0 No

in one file global variable int i; is declared as static. In another file it is extern int i=100; ..

Answer / sumit mondal

yes of course it is valid.

Is This Answer Correct ?    6 Yes 5 No

in one file global variable int i; is declared as static. In another file it is extern int i=100; ..

Answer / guest

yes

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Interview Questions

What is the best way of making my program efficient?

0 Answers  


What are the features of the c language?

0 Answers  


Differentiate between a structure and a union.

0 Answers   Zensar,


write a pgm to print 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1

3 Answers  


A stack can be implemented only using array?if not what is used?

3 Answers   InterGlobal,


how to use enum datatype?Please explain me?

3 Answers   Excel,


Describe the order of precedence with regards to operators in C.

0 Answers  


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

0 Answers  


Derive the complexity expression for AVL tree?

1 Answers  


what is c language.

3 Answers  


Can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?

1 Answers  


Categories