0

Unhandled exception at 0x5F0C08AB (msvcr120d.dll) in ConsoleApplication10.exe: 0xC0000005: Access violation reading location 0x000003E7.

It's weird. I just made new memory. code is too long to show you guys. I debug it and it breaks where the line i used new operator.

7
  • Please post the code that calls the new operator. Jul 12, 2016 at 10:54
  • thanks for the answer. the problem was in other line which is for loop. Index number was the problem. but why didn't the debugger point that line ? is it kind of bug? Furthermore, if index number bigger than array length, it doesn't stop and keep going. why is that? I'm confused. Jul 12, 2016 at 12:20
  • If index number is greater than the array length , it copies garbage value. Jul 12, 2016 at 12:29
  • You didn't state what language you're using but in C++ and C it's indeed possible to access elements outside the array bounds. It could crash the program or produce garbage values. Jul 12, 2016 at 12:31
  • 1
    When compiling, some array bugs can be found using a higher warning level. Static analysis tools like CppCheck can also help. When running the program, you can use tools like Valgrind or enabling more runtime debug options in Visual Studio's settings. Also compiling a Debug build instead of Release enables some error detection. Jul 12, 2016 at 12:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.