简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM