Initial values of variables

About initialization of variables...(read here in cpluplus)
When declaring a regular local variable, its value is by default undetermined


Is there a way to tell that all numeric variables of my program have a default value of 0.
?
Thanks
Last edited on
You have to explicitly assign them zero.

Or, much more verbosely, use boost::value_initialized, which is nothing more than a class that is intended to wrap a fundamental type and initialize it to zero when default constructed.

Topic archived. No new replies allowed.