C++, modify value on the heap VS delete and new

前端 未结 0 1796
迷失自我
迷失自我 2021-02-06 23:41

In a class example in a C++ book, there is an overloading of the assignment operator with the following lines:

delete m_pName;
m_pName = new string(*(c.m_pName));         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题