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

Answers were Sorted based on User's Feedback



wat is the difference between a definition and declaration? float y;---it looks like a declaration...

Answer / kantilal

the diff b/w defination and declaration is
defination is allocating memory to the variable
ddeclaration is telling what type of variable it is and not
allocating memory for it

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

Is This Answer Correct ?    30 Yes 0 No

wat is the difference between a definition and declaration? float y;---it looks like a declaration...

Answer / vignesh1988i

this is declaration as well as definition....
according to me.,
DECLARATION here means that for some maniplation inside the
program we are going to use that variable y... but what is y
we want to tell the compiler so we are giving a new
DEFINITION to the alphabet as float DATA TYPE and thus we
are making the full variable


thank u

Is This Answer Correct ?    4 Yes 0 No

wat is the difference between a definition and declaration? float y;---it looks like a declaration...

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

More C Interview Questions

When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

0 Answers  


Write a program which take a integer from user and tell whether the given variable is squar of some number or not. eg: is this number is 1,4,9,16... or not

9 Answers   Alcatel,


what is the difference between : func (int list[], ...) or func (int *list , ....) - what is the difference if list is an array and if also if list is a pointer

2 Answers  


simple program for virtual function?

1 Answers  


Example of friendly function in c++

2 Answers  






what is develop in c language

2 Answers  


How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST

6 Answers   Adobe, Huawei,


When is a null pointer used?

0 Answers  


write a program to interchange the value between two variable without using loop

1 Answers  


What ios diff. Between %e & %f?

3 Answers   Honeywell,


The statement, int(*x[]) () what does in indicate?

0 Answers  


Is c still used?

0 Answers  


Categories