What is the difference between declaration and definition?

Answer Posted / durga devi sathi

Declaration of a variable means name the variable and tells
compiler that this has been present elsewhere in the program
Definition means that allocate or reserve some space and
store the value in that variable.
the variables like auto and registers, the declaration and
definition done at the same time because they are named the
variable and allocate the memory at the same time.
Ex- int a;//declaration and definition
extern int a;//only declaration
once the variable is defined it is ready to hold the data
value needed by the program

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstraction in oop with example?

742


How do you answer polymorphism?

666


Is oop better than procedural?

657


What are benefits of oop?

734


What is the use of oops?

694






What is multilevel inheritance in oop?

643


What is class and object with example?

674


What is the example of polymorphism?

655


How do you explain polymorphism?

683


Is html an oop?

670


What does <> mean pseudocode?

714


What is cohesion in oop?

724


What is the full form of oops?

784


Why polymorphism is used in oops?

669


What is oops concept with example?

658