+ 3

what is the meaning of uninitialized local variable

1st Jun 2017, 5:26 AM
Tosin J. Akerele
Tosin J. Akerele - avatar
3 Réponses
+ 3
uninitialized variables are ones without values I.e variables which are not assigned values to
31st Oct 2017, 4:32 PM
Tosin J. Akerele
Tosin J. Akerele - avatar
+ 7
int x; // this variable (x) is uninitialized int y = 42; // this variable (y) is initialized with value 42
1st Jun 2017, 5:36 AM
Burey
Burey - avatar
+ 4
Uninitialized local variable is a variable that was declared inside a function but it was not assigned a value. It contains default value for that data type. Using an uninitialized variable in an expression may give unexpected results or cause compilation errors. So you should always initialize variables.
1st Jun 2017, 6:51 AM
Asch
Asch - avatar