There's a code:
int* nums = new int(); nums = 1; // добавим 8й элемент в массив
Why does it work?
They've initiated a mass of three elements.
The compiler has no control over what elements you're dealing with. In handling the mass
numsDuring the performance, it is simply calculated that the mass is moved to this element and that the data are stored. In doing so, these data can be accessed to any object that is remembered by the mass. So the behaviour of the programme that allowed such treatment is absolutely not predictable.
"C" makes it possible to work directly with the operational memory without concealing this work from the programmer, it's a big plus compared to other languages, which is why it's used to write an operating system code (in fact it was created). But that's what makes the programmer responsible for his actions.