Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C Programming- Calling elements in Arrays question.
#5
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.
Reply


Messages In This Thread
C Programming- Calling elements in Arrays question. - by Locked - 2013-04-02, 09:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)