+ 2

Initialising an array

In C++, what if we initialize an integer array of size 5 with just 3 numbers... what will the remaning positions hold? what if in case of a character array?

26th Jul 2017, 6:01 AM
Anjana S. Arjunan
Anjana S. Arjunan - avatar
1 Antwort
+ 8
Your uninitialised array positions may / may not store garbage values, based on your compiler. (Char garbage values are integer garbage values casted to char based on ASCII).
26th Jul 2017, 6:16 AM
Hatsy Rei
Hatsy Rei - avatar