这代码怕是有问题啊 return出来的不是用户想要的,总是要+1或者-1才能用
int List::LocateElem(int * e)
{
for (int i = 0; i <= m_iLength; i++)
{
if (m_pList[i] == *e)
{
return i;
}
}
return -1;
}
{
*preElem = m_pList[temp - 1];
cout << *preElem << endl;
}
}
return false;
}
int List::LocateElem(int * e)
{
for (int i = 0; i <= m_iLength; i++)
{
if (m_pList[i] == *e)
{
return i;
}
}
return -1;
}
{
*preElem = m_pList[temp - 1];
cout << *preElem << endl;
}
}
return false;
}
2018-01-24
举报