Define integer (int); What’s the default value?

In most cases, there is no “default” value for an int object.

If you declare int i; as a (non-static) local variable inside of a function, it has an indeterminate value. It is uninitialized and you can’t use it until you write a valid value to it.

It’s a good habit to get into to explicitly initialize any object when you declare it.

Leave a Comment