Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

No. it is not valid,

Bcos we can not initialise a variable with an extern key
word.ie.,

The statement extern int i = 100; is wrong.

Is This Answer Correct ?    14 Yes 5 No

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

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

More C Interview Questions

How will you print TATA alone from TATA POWER using string copy and concate commands in C?

0 Answers   Amdocs, Apps Associates,


write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};

5 Answers  


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

0 Answers  


What is the difference between fread and fwrite function?

0 Answers  


Is it cc or c in a letter?

0 Answers  


Why is the code below functioning. According to me it MUST NOT.

1 Answers  


What is calloc malloc realloc in c?

0 Answers  


What is time null in c?

0 Answers  


List the different types of c tokens?

0 Answers  


is assignment operator is arithmatic or not

3 Answers   Infosys,


Is c is a middle level language?

0 Answers  


What is the full form of getch?

0 Answers  


Categories