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

The program to allow the characters from the input received and send this function to a function check if the characters between letters a to z is a function of y joins as the characters main and output to otherwise return to the original function of the y characters

0 Answers  


write a program to display the numbers in the following 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

1 Answers  


Write a program in c to print * * * * * *******

1 Answers  


Explain About fork()?

0 Answers   TISL,


write a c program to find the probability of random numbers between 1-1000

0 Answers   ADS,






why effort estimation is important?

1 Answers  


which one low Priority in c? a)=,b)++,c)==,d)+

10 Answers  


What is main void in c?

1 Answers  


What is the deal on sprintf_s return value?

0 Answers  


main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*

1 Answers  


In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?

4 Answers  


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

0 Answers  


Categories