I keep stepping on my variables in Visual Studio 2005 (C++) because I'm exceeding my array bounds. Visual Studio doesn't have a problem with this; it just overwrites whatever was in the previous variable and continues. It can lead to strange results in my program, and it takes forever to track down such problems.
Is there a switch a I can flip somewhere in the Visual Studio 2005 IDE to warn me if I'm exceeding my array bounds?
In Visual Studio 2005, is there any such thing as array bounds checking?
Within the .Net framework, array bounds checking is automatic. Array access is automatically checked to ensure a valid element is accessed. The only exception to this is when you use unsafe code: array bounds checks are ignored. Also, if you call into native (i.e. not managed) code, then obviously the array bounds checking of that native code is going on (and usually their is none).
If you can exceed the bounds of an array by accessing an element beyond it, I would suspect your installation of the .Net framework is corrupt and I would reinstall it.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment