I can think of some languages that let you use variables uninitialized

by Dean Menezes (Login dean.menezes)
R

Java initializes numerical types to zero.

In C,

int i;

makes i take up the sizeof(int) bytes on the stack but it is filled with whatever garbage was there earlier.

However, both of these languages require you to declare the type of a variable.

Some FORTRAN 77 compilers might let you use uninitialized variables as zero. Of course, new Fortran programs should probably use implicit none, and most compilers for both C and Fortran let you force warnings for uninitialized variables.



    
This message has been edited by dean.menezes on Apr 22, 2009 3:17 PM
This message has been edited by dean.menezes on Apr 22, 2009 3:00 PM

Posted on Apr 22, 2009, 2:51 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
* What does this have to do with QB64? on Apr 22
 It is a response to rpgfan's post about python not allowing uninitialized variablesqbguy on Apr 22
  * Why would you want it to? on Apr 22