what is the difference between declaration ,defenetion and
initialization of a variable?

Answer Posted / gg

As i know.....
Definition is one which allocates memory.
Ex: int x;

Declaration never occupy any memory space.
Ex:Function prototype declarations such as....
int func(int,int);

Initialization: If any variable assigned with some value at
time definition itself is called initialization.
Ex:int x=0;

Is This Answer Correct ?    35 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the explanation for prototype function in c?

557


difference between object file and executable file

6082


Differentiate between calloc and malloc.

745


Explain what are compound statements?

595


What is the difference between local variable and global variable in c?

677






Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

636


What is union and structure in c?

604


What does node * mean?

700


Why enum is used in c?

513


What is the difference between #include

and #include “header file”?

541


what is the function of pragma directive in c?

611


What is pass by value in c?

589


What is the right way to use errno?

610


What are the advantages of using linked list for tree construction?

633


What's the total generic pointer type?

604