C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. 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
Create a class named StudentRecords and add a static variable named records, which is a list shared among all objects of the class. Then add a method named add_record that takes a student's name as input and appends it to the shared records list.
Subject: Database management system Explain in easy way with write  handwritten note   Test if the following schedule is conflict serializable or not and explain R1 (A), R2 (D), W1 (B), R2 (B), W3 (B), R4 (B), W2 (C), R5 (C), W4 (E), R5 (E), W5 (B).
Subject: Database management system Explain in easy way with write  handwritten note   Test if the following schedule is conflict serializable or not and explain R1 (A), R2 (D), W1 (B), R2 (B), W3 (B), R4 (B), W2 (C), R5 (C), W4 (E), R5 (E), W5 (B).
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education