C++ PROGRAMMING LMS MINDTAP
C++ PROGRAMMING LMS MINDTAP
8th Edition
ISBN: 9781337696173
Author: Malik
Publisher: Cengage Learning
Expert Solution & Answer
Book Icon
Chapter 13, Problem 1TF

Explanation of Solution

  1. Function that overloads an operator is called the operator function. Hence the statement is true.

  2. The operators that cannot be overloaded are- ., .*, ::, ?:, and sizeof. Hence the statement is false.

  3. In C++, operators cannot be redefined for built-in types but overloaded for user-defined types. Hence the statement is false.

  4. C++ does not allow users to create their own operators. Only built-in types can be overloaded. Hence the statement is false.

  5. Neither the precedence nor the associativityof an operator can be changed. Hence the statement is false.

  6. A friend function of a class is a non-member function of the classbut can access all the members of the class. Hence the statement is false.

  7. When writing the definition of a friend function, the keywordfriend must not appear in the function heading. The word friend appears only in the function prototype in the classdefinition, not in the definition of the friend function. Hence the statement is false.

  8. In C++, not all operators can be overloaded as member functions ofa class. The operators that cannot be overloaded are - ., .*, ::, ?:, and sizeof. Hence the statement is false.

  9. Every instance of an overloaded function has the same number ofparameters, as thenumber of parameters that the operator takes cannot be changed. Hence the statement is true.

  10. It is necessary to overload relational operators for any user defined class if any relational operation is required using that class, irrespective of its member variable types. Hence the statement is false.

  11. To distinguish between pre- and post-increment operator overloading, a dummy parameter (of type int) is used in the function heading of the operator function for the post-increment operator. Hence the statement is false.

  12. Templates provide the capability for software reuse by using the same logic or algorithm for multiple datatypes. Templates enables use of a single code segment for a set of relatedfunctions or classes. Hence the statement is true.

  13. The function members of a class template are considered function templates - when giving the definitions of the function members of a class template, the definition of the function template is to be followed. Hence the statement is true.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
C++ question   Q.Explain with an example how one user defined data type can be converted to a predefined data type.
True or false: C++ class objects are always passed to functions by reference.
3. Write a C++ program using an overloaded * operator that multiplies two objects using Arrays and return the value its value. Use class name Arr(). (40)
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning