void CBase::Swap(double cost[],int i,int j)这样定义的交换函数为什么会引起内存溢出??voidCBase::Swap(
void CBase::Swap(double cost[],int i,int j)这样定义的交换函数为什么会引起内存溢出??
void CBase::Swap(double cost[],int i,int j)
{
double t=cost[i];
cost[i]=cost[j];
cost[j]=cost[i];
}
用来交换数组成员
[解决办法]
没法保证i、j不超出数组范围。
