Answer the following questions true (T) or false (F)

1. When defining a member function of a class, say class A, you can access only private members of the calling object, not those of parameter objects, although they might be of the same class type.

2. One can guarantee left to right evaluation of the arguments to a comma expression overloading.

1. False
Explanation:
The text says it clearly: “A class has access to all its objects.”. When defining a member function or member operator function of a class, you are allowed to access any member, public or private of any object of the class whose member is being defined.
2. False
Invocations of overloaded operators are function calls. All the arguments of function calls are evaluated before the function is called, but there is no guarantee that any two compilers will generate code with left to right evaluation. It is better not to overload the comma operator.

Computer Science & Information Technology

You might also like to view...

Formatting text helps the reader see the organization of a document and identify important information or ideas

Indicate whether the statement is true or false

Computer Science & Information Technology

In multiple inheritance, the derived class is derived from more than one base class.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology