front
is a pointer to Node
, but next
is a private member in Node
template <class T>
class Node{
T item; // since you didn't specify access level
Node * next; // explicitly the access is private by default
Node(){item=0; next=NULL;}
Node(T n){item=n; next=NULL:}
};
so you cannot use it in queue
class:
front=front->next; // error
change it to be public
or redesign the program
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…