C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

What is the difference between declaring a variable and defining a variable?

0 votes
22 views
asked Apr 7, 2014 by sunny Expert (11,410 points)

1 Answer

0 votes
Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. You can also initialize a variable at the time it is defined.
answered Apr 7, 2014 by rock Expert (14,990 points)

Related questions

0 votes
1 answer 87 views
0 votes
1 answer 158 views
+1 vote
1 answer 56 views
0 votes
1 answer 37 views
37 views asked Apr 8, 2014 by rock Expert (14,990 points)
0 votes
1 answer 1,473 views
...