2013-04-02, 09:17 PM
Accessing out of bound elements, whether positive or negative is undefined behaviour. Undefined behaviour are parts of the standard that don't explicitly define their behaviour when ran.
While Paul's compiler (VC++) might print 20, other compilers will have completely different outputs. In my machine it prints 0, because we cannot be sure of the defined behaviour of the program.
While Paul's compiler (VC++) might print 20, other compilers will have completely different outputs. In my machine it prints 0, because we cannot be sure of the defined behaviour of the program.

