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

What is the importance of c in your views?

597


How to get string length of given string in c?

609


How can I avoid the abort, retry, fail messages?

663


Explain what is the difference between the expression '++a' and 'a++'?

627


What is a const pointer?

638






Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol

667


What is an operator?

658


What does c in a circle mean?

583


What is hungarian notation? Is it worthwhile?

699


When is a void pointer used?

678


What is pivot in c?

568


What is external variable in c?

613


What is main () in c?

588


what do you mean by enumeration constant?

599


How do you do dynamic memory allocation in C applications?

630