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...

When used as parameters, these types of variables allow a function to access the parameter's original argument:

a. reference b. floating-point c. counter d. undeclared e. None of these

Computer Science & Information Technology

When the mask and the masked layers are ____, only the content in the masked layer that is behind the mask layer object becomes visible.

A. locked B. unlocked C. embedded D. linked

Computer Science & Information Technology

An install program is also called a(n) ________ program

Fill in the blank(s) with correct word

Computer Science & Information Technology

Excel recognizes an entry as a value if it is a number or it begins with ____.

A. + B. = C. $ D. All of the above.

Computer Science & Information Technology