COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Instance
|
|
Call function
|
|
dot(".")operator
|
|
none of the choices
|
Detailed explanation-1: -(dot) operator is used to access class, structure, or union members. The member is specified by a postfix expression, followed by a . (dot) operator, followed by a possibly qualified identifier or a pseudo-destructor name. (A pseudo-destructor is a destructor of a nonclass type.)
Detailed explanation-2: -The explanation: The data members can never be called directly. Dot operator is used to access the members with help of object of class. Arrow is usually used if pointers are used.
Detailed explanation-3: -Access to class members: The object can access the public data member and member functions of a class by using dot (.) and arrow (->) operators.
Detailed explanation-4: -Class Member Access Operator (->) Overloading in C++ The class member access operator (->) can be overloaded but it is bit trickier. It is defined to give a class type a “pointer-like” behavior. The operator-> must be a member function.
Detailed explanation-5: -How to access the object in the class? Explanation: Objects in the method can be accessed using direct member access operator which is (.).