+ 2
Why I am getting this type of output?
5 Réponses
+ 2
When you printing myArr[x] , x=5 which is undefined value and x=5 is out of range for index value for the array..
its undefined garbage value displaying..
+ 2
Ok thanks Jayakrishna🇮🇳
+ 1
Run it multiple times to get different outputs
0
You're welcome..
0
To avoid out of bound calls, you can use STL std::array from <array>. This template class container has member function "at()" which throws an exception when you try to call out of bound position