Has anyone used a reference to a pointer in C++ (TreeNode *&root)

I was thinking of passing a pointer as a reference in order to solve several linked list and tree questions.

This syntax is like - TreeNode *&root;
Has anyone tried this. Is it legal to use in coding interviews or it throws exception at any point of time. (Asking as a beginner). Any clue/help will be appreciated.

Comments (3)