+ 2
What is the difference between a declaration and definition(initialization) of a variable?
2 odpowiedzi
+ 1
int a; <-- declaration. We declare variable, but we do not assign any value.
int b = 6; <-- Initialization. We declare variable + we assign value.
+ 1
int a; //declaration
int a=7 or a=7 //definition