[c++] Why the following code is working ? | Sololearn: Learn to code for FREE!


[c++] Why the following code is working ?

why the code is working fine ? goto: https://code.sololearn.com/cA9a25a96A09


4/27/2021 5:04:31 AM


3 Answers

New Answer




Your program is showing an undefined behaviour. C++ doesn't specify what to do when a program tries to access values outside the limit of arrays, so the behaviour of the program can't be determined there.


5 elements of 5 bytes each 23 is just 1 element out of 5 The one-dimensional array can hold 5 elements.😎