Filters
Question type

In an overloaded insertion or extraction operator,which object should be the first parameter,the stream or the object of the class?


A) the stream
B) the object
C) it doesn't matter
D) none of the above

Correct Answer

verifed

verified

What member functions do you need to allow the compiler to perform automatic type conversions from a type different than the class to the class?


A) Overloaded constructors
B) Converters
C) This can not be done
D) This already happens automatically

Correct Answer

verifed

verified

Operators can be overloaded as


A) friends of a class
B) members of a class
C) non-friends,non-members of a class
D) All of the above

Correct Answer

verifed

verified

Write the function declaration for an assignment operator for a class named myClass

Correct Answer

verifed

verified

void operator= const...

View Answer

Which of the following are not correct?


A) The destructor of a class is not named the same as the name of the class,but preceded with a tilde
B) The destructor of a class is not called when an object of the class goes out of scope
C) The destructor of a class is not a member of the class
D) The destructor of a class is a void function
E) all of the above

Correct Answer

verifed

verified

If you have mutators and accessors,you should not have friend functions also

Correct Answer

verifed

verified

The copy constructor for a class is called


A) when an object of the class is passed by value to a function.
B) when an object of the class is initialized by another object of the class
C) when a function returns an object of the class
D) all of the above

Correct Answer

verifed

verified

Friend functions may directly modify or access the private data members.

Correct Answer

verifed

verified

How many parameters are there in a binary operator implemented as a friend?


A) 0
B) 1
C) 2
D) as many as you need

Correct Answer

verifed

verified

Showing 41 - 49 of 49

Related Exams

Show Answer