We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码仓库没有给出,书上给出了
//copy operator CMyString& CMyString::operator=(const CMyString& str) { if(m_pData != &str) { CMyString tmpData(str); char *ptmp = tmpData.m_pData; tmpData.m_pData = m_pData; m_pData = ptmp; } return *this; }
m_pData是private的,书上写的有点问题
The text was updated successfully, but these errors were encountered:
private 在这里没影响吧
Sorry, something went wrong.
@hezhiqiangTS tmpData.m_pData 这里,private不能这么写吧
不懂,可以解释一下吗?
同问,tmpData不能直接访问它的private成员吧?需要通过成员函数访问的吧? 但是自己写代码测试也是能通过,现在很疑惑,求懂的同学解答!
No branches or pull requests
代码仓库没有给出,书上给出了
m_pData是private的,书上写的有点问题
The text was updated successfully, but these errors were encountered: