By default, variables in Pascal are not initialized after their declaration.
x, y: integer = 0;
x: integer = 0;y: integer = 0;
QuoteBy default, variables in Pascal are not initialized after their declaration.Is there a compiler option or some tools that change this behavior and automatically initialize integers to 0 etc?
Also, why does Pascal not allow initialization of multiple variables of the same type? eg. Code: [Select]x, y: integer = 0;instead we have to doCode: [Select]x: integer = 0;y: integer = 0;
I think objects have their fields set to zero on Create.
Quote from: creaothceann on December 08, 2016, 05:51:06 pmI think objects have their fields set to zero on Create.Classes have, objects have not.