158k views
14 votes
What does it mean to “declare a variable”

User Ken Yu
by
5.4k points

1 Answer

0 votes

Answer:

Declaration of a variable is for informing to the compiler the following information: name of the variable, type of value it holds and the initial value if any it takes. i.e., declaration gives details about the properties of a variable. Whereas, Definition of a variable says where the variable gets stored.

Step-by-step explanation:

Have a good day

User Richard Burton
by
4.8k points