C++error C2227: “->link”的左边必须指向类/结构/联合/泛型类型
我想展示无头节点单循环链表template<typenameT>voidcircList<T>::output(){inti=0;CircLinkNode<T>*curr...
我想展示无头节点单循环链表
template<typename T>
void circList<T>::output()
{
int i = 0;
CircLinkNode<T>* current = first;
while (current!=NULL&*t->link!=first)
{
cout << "#"<< i<<":" << current->data << endl;
current = current->link;
i++;
}
cout << "#" << i << ":" << current->data << endl;
} 展开
template<typename T>
void circList<T>::output()
{
int i = 0;
CircLinkNode<T>* current = first;
while (current!=NULL&*t->link!=first)
{
cout << "#"<< i<<":" << current->data << endl;
current = current->link;
i++;
}
cout << "#" << i << ":" << current->data << endl;
} 展开
2个回答
展开全部
while (current!=NULL&*t->link!=first)
修改成
while (current!=NULL && t->link!=first)
修改成
while (current!=NULL && t->link!=first)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询