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 are the types of arrays in c?

0 Answers  


Compare array data type to pointer data type

0 Answers  


Explain what is wrong with this program statement? Void = 10;

0 Answers  


What is a pointer and how it is initialized?

0 Answers  


What does a function declared as pascal do differently?

0 Answers  


Explain how many levels deep can include files be nested?

0 Answers  


helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe

2 Answers  


What is a string?

0 Answers  


Is c a great language, or what?

0 Answers  


What is difference between far and near pointers?

0 Answers  


How do we declare variables in c?

0 Answers  


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

0 Answers  


Categories