Skip to main content

Initialisation

Definition:
Assigning an initial value to a variable at the time of declaration or later.


Detailed Explanation

  • Initialisation stores a first value into a variable.
  • It can occur at declaration or at a later point in the program.
  • Helps avoid undefined or unexpected behavior from uninitialized memory.

Example

// Declare and initialise // int score = 0;

// Declare first, initialise later // int score; // score = 0;


⬅ Back