拷贝构造函数中m_iCount = arr.m_iCount;先赋值和后赋值为什么为有不同的结果?
Array::Array(const Array&arr)
{
行1:m_iCount = arr.m_iCount;
m_pArr = new int[m_iCount];
for (int i = 0; i < m_iCount; i++)
{
m_pArr[i] = arr.m_pArr[i];
}
将行1放入最后一行
Array::Array(const Array&arr)
{
行1:m_iCount = arr.m_iCount;
m_pArr = new int[m_iCount];
for (int i = 0; i < m_iCount; i++)
{
m_pArr[i] = arr.m_pArr[i];
}