www.thecareerplus.com
The CareerPlus
Home Technical Resources Programming Variables and Data types
Wednesday 08th September 2010
 
 
What is the difference between the declaration and the definition of a variable?

Discuss it!          


The definition is the one that actually allocates space, and provides an initialization
value, if any.
There can be many declarations, but there must be exactly one definition. A definition
tells the compiler to set aside storage for the variable. A declaration makes the
variable known to parts of the program that may wish to use it. A variable might
be defined and declared in the same statement.

Discuss it!          

CrackTheIntervew.NET
Advertisement
 
Top! Top!