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 many keywords (reserve words) are in c?

614


explain what is a newline escape sequence?

683


What are the basic data types associated with c?

811


When should the volatile modifier be used?

678


What is the process to create increment and decrement stamen in c?

583






What is a void pointer? When is a void pointer used?

618


What is the full form of getch?

580


what is uses of .net

1273


praagnovation

1774


What language is lisp written in?

613


What are linked lists in c?

647


Do you know what are the properties of union in c?

578


can we change the default calling convention in c if yes than how.........?

2030


Is it acceptable to declare/define a variable in a c header?

678


What is c basic?

591