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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you have any idea about the use of "auto" keyword?

671


What is %lu in c?

691


What is || operator and how does it function in a program?

635


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

616


Should a function contain a return statement if it does not return a value?

601






How can I sort a linked list?

639


Write a code to remove duplicates in a string.

633


Is null always equal to 0(zero)?

589


Explain how can I open a file so that other programs can update it at the same time?

599


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

2806


What does do in c?

615


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

617


How can I invoke another program or command and trap its output?

621


What does it mean when the linker says that _end is undefined?

638


Write a code of a general series where the next element is the sum of last k terms.

598