Einzelnen Beitrag anzeigen

Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.345 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Delphi Variable Initialization

  Alt 11. Aug 2017, 11:38
Laut Google sind in Delphi globale Variablen immer auf 0/nil initialisiert, lokale aber unintialisiert, also undefined. Darauf verlassen würde ich mich aber nicht.
Da kann man sich schon drauf verlassen, das ist auch dokumentiert, einfach mal in die Doku schauen:
http://docwiki.embarcadero.com/RADSt...o/en/Variables
Zitat:
If you do not explicitly initialize a global variable, the compiler initializes it to 0. Object instance data (fields) are also initialized to 0. On the Wiin32 platform, the contents of a local variable are undefined until a value is assigned to them.
Sebastian Jänicke
Alle eigenen Projekte sind eingestellt, ebenso meine Homepage, Downloadlinks usw. im Forum bleiben aktiv!
  Mit Zitat antworten Zitat