|
Posted by: Pete S on 2010-01-25, 23:24:32
C+ + isn't like Java, there isn't much built in Exception checking. So typically the variable a gets declared on the stack, which is a specified size for your program. As long as you don't get to some point outside of your program's allocated memory space from the operating system, C+ + isn't going to stop you. In this case, you're just accessing some other memory in your program, probably in its stack space, which doesn't cause a major problem. The code of course is still wrong, but C+ + isn't going to keep you from shooting yourself in the foot unlike Java and other languages. |