csStudent
csStudent

Reputation: 128

understanding this function prototype

In my CS class we are learning about how structs are not considered OOP and in our program we have to use a node class instead of struct now. In class node there is a function

node *& go_left();

What does the *& in the declaration mean? The class is also called node, so does that mean it's returning a pointer to another node object?

Upvotes: 0

Views: 70

Answers (1)

ZoidMeister
ZoidMeister

Reputation: 13

The "node" is a class and therefore becomes a user defined data type. As far as the Node *& is concerned, your method returns a pointer of the type "node", by reference

Upvotes: 1

Related Questions