Doubt in accessing class members

I’m confused when we use ’ . ’ ( line 138 ) and when we use ’ -> ’ ( line 142 ). Please clarify this. Thanks in advance.

. dot is used to access the property of objects
and -> arrow is used to access the property of pointer

Pair p; // p is object of class Pair
so to access its property we use .(dot) 
like p.daimeter , p.height etc

node*root;  //root is pointer of class node
hence to access it's property we will use ->(arrow)
like root->left ,root->right etc.

i hope you understand the concept
if your doubt is resolved plz mark it as resolved from your side
else feel free to ask

Thanks for the clarification. I’m closing the doubt.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

plz give feedback it’s imp
thanks