1.

Which operator should be used to access the members of the class using object pointer?(a) Dot operator(b) Colon to the member(c) Scope resolution operator(d) Arrow operatorI had been asked this question by my school teacher while I was bunking the class.I'd like to ask this question from Pointer to Objects in division Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Right option is (d) ARROW operator

The best EXPLANATION: The MEMBERS can be ACCESSED from the object POINTER by using arrow operator. The arrow operator can be used only with the pointer of class type. If simple object is declared, it must use dot operator to access the members.



Discussion

No Comment Found

Related InterviewSolutions