[C++] 指针使用异常记录_ns3 ping 错误assert failed. cond="m_ptr", msg="attem-CSDN博客

网站介绍:文章浏览阅读312次。背景最近在线上so开发过程中,遇到core dump问题,猜测可能是指针所指向的变量值为NULL导致,请教了周围大神,发现了指针误操作导致的内存异常。问题复现#include <iostream>#include <vector>#include <ctime>using namespace std;struct ItemInfo { int id; string name; float score;};static const char_ns3 ping 错误assert failed. cond="m_ptr", msg="attempted to dereference zero