What does the -> operator do in the context of pointers in C++? 

  • Duplicates the pointer 
  • Adds values 
  • Dereferences pointer and accesses member 
  • Multiplies pointer values
The -> operator in C++ is used with pointers to objects. It dereferences the pointer and accesses the member of the object. For instance, if p is a pointer to an object, p->member accesses the member of the object.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *