In C++, both external variables and static variables are initialized to zero by the system if they are not explicitly initialized by the programmer. This includes arrays, strings, pointers, structures, and unions.
This means that
- for non-string arrays, each element is initialized to zero
- for strings, the string is initialized to a null string
- for structures and unions, each member is initialized to zero.
Automatic and register variables, however, usually are not initialized by the system. This means they can start with "garbage" values.