0

Integer type variables are initialized by default in a strange way.
Look at this code:

MODULE MyTest;
    IMPORT Log;
    PROCEDURE Start*;
    VAR a, b, c, d: INTEGER; (* This variables *) 
    BEGIN
        Log.Int(a);
        Log.Ln;
        Log.Int(b);
        Log.Ln;
        Log.Int(c);
        Log.Ln;
        Log.Int(d);
        Log.Ln;
    END Start;
END MyTest

Here is the result:

4233640
2287340
2287344
576

Thanks!

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
Yakoffs
  • 17
  • 4
  • 1
    What language is this? It's not standard Pascal, Delphi, or FreePascal. You've also not asked a question. – Ken White Nov 29 '13 at 16:20
  • He says Component Pascal, which is afaik closer to Oberon2 than to Pascal. It was rebranded for marketing reasons. The .NET version is one of the original 5-6 .NET languages afaik. the pedigree is Pascal ->m2->m3->Oberon->Oberon2. – Marco van de Voort Nov 29 '13 at 17:50

1 Answers1

1

Like most Wirthian languages, probably variables(and specially local ones) are probably uninitialized. They may be initialized by chance, but usually there is no guarantee.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89