wat is the difference between a definition and declaration?
float y;---it looks like a declaration..but it s a
definition.how?someone explain

Answer Posted / dally

defination is allocating memory to the variable.
but declaration is telling what type of variable it is and
not allocating memory for it.

Ex.int i;
extern int b;

here int i is definition because variable of value is
allocated in memory.
but variable b declared as int variable but memory is not
allocated for this.

float y is defination as compiler allcates memory for it
if you give as extern float y it is declaration

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1462


What are the c keywords?

744


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

652


In which language linux is written?

595


Where define directive used?

598






What is a null string in c?

579


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

586


How is a pointer variable declared?

588


What is the purpose of type declarations?

673


Subtract Two Number Without Using Subtraction Operator

348


What are the types of type specifiers?

617


Why does the call char scanf work?

611


What is the difference between typedef struct and struct?

592


What are operators in c?

575


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

661