String& String::operator=(const string& other)
{
 if(this == &other)
 {
  return *this;
 }
 delete m_data;
 m_data = new char[strlen(other.m_data)+1];
 strcpy(m_data,other.m_data);
 return *this;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-11-30
  • 2022-01-13
猜你喜欢
  • 2022-01-09
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
相关资源
相似解决方案