



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Quiz; Class: Problem Solving with C++; Subject: Computer Science; University: Colorado State University; Term: Unknown 1989;
Typology: Quizzes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




(a) In C++, all operators can be overloaded for user-defined types.
(b) In C++, operators cannot be redefined for built-in types.
(c) The function that overloads a function is called the operator func- tion.
(d) C++ allows users to create their own operators.
(e) The precedence of an operator cannot be changed but its associa- tivity can be changed.
(f) It is not necessary to overload relational operators for classes that have only int member variables.
(g) When writing the definition of a friend function, the keyword friend must appear in the function heading. The function head-
ing of the operator function to overload the pre-increment operator (++) and the post-increment operator (++) is the same because both operators have the same symbols.
class mystery { ... bool operator<=(mystery); ... };
bool mystery::<=(mystery rightobj) { ... }
class mystery { ... bool operator<=(mystery, mystery); ... };
class mystery { ... friend operator+(mystery); //overload binary + ... };
(a) In C++, pointer is a reserved word. (b) In C++, pointer variables are declared using the word pointer. (c) The statement delete p deallocates the variable pointer p. (d) The statement delete p deallocates the dynamic variable that is pointed to by p.