阅读背景:

将链接列表插入链接列表

来源:互联网 

I wrote this function that inserts another linked list to the existing linked list. The output is correct when I print out the value of "this" object in the function. However, the program encounters run time error when the destructor gets invoked in the end. I figured that the run time error is caused by having 2 pointers pointing to the same address; therefore when one gets de-allocated, another one becomes the dangling pointer.I wrote this function that inserts another link




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: