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

What is Your Name :)

1 Answers  


When do we get logical errors?

0 Answers  


WHAT IS INT?

8 Answers   Accenture,


What are data types in c language?

0 Answers  


what do you mean by defining a variable in our c code?

2 Answers  






What are file streams?

0 Answers  


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

2 Answers   Aricent, Manipal University,


What is a memory leak? How to avoid it?

1 Answers  


whats the use of header file in c?

2 Answers  


What is the heap?

0 Answers  


How to write a multi-statement macro?

0 Answers  


What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort

3 Answers   Accenture,


Categories