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

What is the difference between strcpy() and memcpy() function in c programming?

626


Difference between malloc() and calloc() function?

654


Why isnt any of this standardized in c?

637


Explain function?

665


What is conio h in c?

624






if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1450


What is an lvalue?

636


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

656


What are pointers really good for, anyway?

617


What are the keywords in c?

643


ATM machine and railway reservation class/object diagram

4805


What is a substring in c?

588


What happens if a header file is included twice?

598


Explain what does the format %10.2 mean when included in a printf statement?

782


What does & mean in scanf?

604