This is in reference to C++. This question I have goes back about 6 months, when I used to think that a declaration was:
int a;
And a definition was:
a = 5;
Also, that:
int a = 5;
was both a declaration and definition.
I've now come to understand that:
int a;
Is a definition, not just a declaration. (I don't know why).
Also, there are terms such as assigning, and initialising which add further jargon to the issue.
So here is my current understanding (and please correct anything):
int a; // Declaration and definition
int a = 5 // Declaration, definition, assignation and initialisation.
a = 5; // Initialising (if for the first time),
// assigning (if for subsequent times),
// defining (not sure about this one).
I have read quite a bit on this topic but am still confused. Can someone explain exactly what each is? I know that in such cases there are philosophical disputes, like is zero an even number, or even a number. Haha, but can someone try? Thanks.