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

Answer Posted / dipti

No its in valid as a static variable cannot be declared as extern.
The whole and entire purpose of static is to declare that a variable is private to the source file that it is declared in.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we declare variables in c?

789


What is the heap?

950


Which header file is used for clrscr?

778


What is the general form of #line preprocessor?

767


Where define directive used?

809


Explain the properties of union. What is the size of a union variable

920


How to write a multi-statement macro?

813


Is c easier than java?

784


Do you know pointer in c?

801


Here is a good puzzle: how do you write a program which produces its own source code as output?

843


What is the size of array float a(10)?

894


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

863


how to write optimum code to divide a 50 digit number with a 25 digit number??

2989


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

973


How will you delete a node in DLL?

935