-4

当我在 Visual Studio 中调试我的 c 项目时,我得到了这个输出:

'SR.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).
'SR.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).
'SR.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Symbols loaded (source information stripped).
'SR.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
First-chance exception at 0x00171d63 in SR.exe: 0xC0000005: Access violation reading location 0xcccccccc.
Unhandled exception at 0x00171d63 in SR.exe: 0xC0000005: Access violation reading location 0xcccccccc.

是什么导致了问题?

4

2 回答 2

1

您尝试在该地址读取某些内容,但0xcccccccc该地址不是有效的内存地址。

可能是指针初始化错误。

于 2012-10-30T16:24:00.377 回答
0

Turn on "Break when an exception is thrown" in Visual Studio. Quick Key: Ctrl-Alt-E and select Native Run Time Checks and C++ exceptions. Re-debug, and it should stop on the errant code.

于 2012-10-30T16:29:40.687 回答