In the section "Working draft C ++, 2012-11-02"
3.6.2 Initialization of non-local variables [basic.start.init]
2 Variables with static storage duration (3.7.1) or thread storage duration (3.7.2) must be initialized with zeros (8.5) before any other initialization.
Variables with static storage are initialized with at least zero.
3.7.3 Automatic storage duration [basic.stc.auto]
2 [Note. These variables are initialized and destroyed as described in 6.7. - final note]
6.7 says nothing about how automatic variables are initialized.
3.7.4 Dynamic storage duration [basic.stc.dynamic]
...
3.7.4.1 Distribution Functions [basic.stc.dynamic.allocation]
... There are no restrictions on the contents of the allocated storage when returning from the distribution function. The order, contact, and initial value of the vault allocated by successive calls are not specified by the distribution function.
8.5 Initializers [dcl.init]
7 By default, an object of type T is initialized:
- if T is a (possibly cv-qualified) type of class (section 9), the default constructor for T is called (and initialization is poorly formed if T does not have an available default constructor); - if T is an array type, each element is initialized by default;
- otherwise, initialization fails.
If you provide an explicit initializer, any variable will have a known value.
If you do not provide an explicit initializer for the POD type, it depends on the storage class. Static or stream variables will be initialized to zeros, while automatic or dynamically allocated variables are not.
If you have a complex type, the same rules apply. If you do not have an explicit initializer, through the constructor (by default) or otherwise, the initial value of the main types depends on the storage class.
Finally, memory allocated through malloc will be uninitialized, while calloc memory will be initialized to zero.