Difference between Declaration and Definition of a variable. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Difference between Declaration and Definition of a variable.

26th Aug 2019, 5:46 PM
Muhammad Mehran Bin Azam
Muhammad Mehran Bin Azam - avatar
2 Answers
+ 5
Declaration ========= int x; Definition ======== x = 50; Both ==== int x = 50;
26th Aug 2019, 6:06 PM
Dlite
Dlite - avatar
0
to declare means you are simply telling the programme that a variable exists and what type it is to define (or assign) a variable means you are telling the programme what the variable represents (or what is put into it in layman’s terms)
26th Aug 2019, 8:21 PM
Brave Tea
Brave Tea - avatar