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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

669


List the difference between a "copy constructor" and a "assignment operator"?

586


Which programming language is best for getting job 2020?

608


while initialization of array why we use a[][2] why not a[2][]...?

1869


What is realloc in c?

581






What is data type long in c?

626


How is a null pointer different from a dangling pointer?

558


how many errors in c explain deply

1632


Explain high-order and low-order bytes.

670


Can we change the value of constant variable in c?

579


Why is void main used?

622


Can a variable be both static and volatile in c?

609


Are bit fields portable?

680


where are auto variables stored? What are the characteristics of an auto variable?

596


What are the advantages and disadvantages of c language?

563