If I want to put the struct Node's statement in the private, I again how to outside the class defines a return value is the function of Node *? Or say if do like this Node must be declared in public?
Bosses give directions,
templateThe class List
{
Public:
Struct Node
{
T data;
Node * next;
};
Data Node * getnode (T);
Private:
Int length;
Node * head;
Node * p;
};
The template & lt; Typename T> List: : Node * List : : getnode (T, n)
CodePudding user response:
Ah, the last line is I want to define the function, forgot to write the {}CodePudding user response:
The friend function,,,