C/C++调试笔记:空指针报错The inferior stopped because it received a signal from the operating system.

问题描述:程序编译不报错,运行异常退出The program has unexpectedly finished.

调试系统报错:

The inferior stopped because it received a signal from the Operating System.

Signal name: SIGSEGV

Signal meaning: Segmentation fault

搜索错误提示出现空指针或野指针

一直致力于对定义的类指针的初始化,忽略程序运行中使用语句memset(&staticdata,0,iLengthStaticCmd);

将指针staticdata地址置零,导致出现错误。


调试时应从变量定义到使用一步步进行调试,观察指针从开始到结束的变化,找到错误可能发生的地方。





你可能感兴趣的:(C/C++调试笔记,C/C++)