Declaration, initialization, instantiation

Previous: Variable assignment and initialization in C++

Declaration: Telling the compiler that a variable or object exists, specifying its type. No memory for the actual value is necessarily allocated (depends on context). Example:

Initialization: Assigning an initial value to a variable or object. Happens after declaration or at the same time. Example:

Instantiation: Creating an instance of a class (an actual object). Involves memory allocation for the object. Example: