Quiz 5 (OOO)

Ace your homework & exams now with Quizwiz!

A(n) ________ is a special function that is called whenever a new object is created and initialized with another object's data.

copy constructor

A member function that is declared ________ may not access any non-static data members in the class.

static

If a member is declared ________, all objects of that class have access to that variable.

static

The ________ member variable may be accessed before any objects of the class have been created.

static

Which of the following operators may be used to assign one object to another?

=

It is a good idea to make a copy constructor's parameters ________ by specifying the ________ key word in the parameter list.

constant, const

If you do NOT furnish a ________, a default one will be provided by the compiler.

All of these

The overloaded = operator copies data from one object to another so it is known as the overload copy operator.

False

When a class declares an entire class as its friend, the friendship status is reciprocal. That is, each class's member functions have free access to the other's private members.

False

By default, when an object is assigned to another object, each member of one object is copied to its counterpart in the other object.

True

When you overload an operator, you can change the operator's original meaning to something entirely different.

True

When objects contain pointers, it is a good idea to create an explicit ________ function.

copy constructor

In the following function header, the word int is known as a(n) ________.

dummy parameter

A(n) ________ informs the compiler that a class will be declared later in the program.

forward declaration

Which type of function is NOT a member of a class but has access to the private members of the class?

friend

In C++11 values that persist beyond the statement that created them and have names that make them accessible to other statements in the program are called

lvalues

Each object of a class has its own copy of the class's

member variables

In C++11 the ________ operator swaps the members of the object being assigned with the temporary object.

move assignment

When a class contains an instance of another class, it is known as

object composition

When you overload an operator, you cannot change the number of ________ taken by the operator.

operands

To overload the + operator, you would write a function named

operator +

An ________ operator can work with programmer-defined data types.

overloaded

When you redefine the way a standard operator works when it is used with class objects, you have ________ the operator.

overloaded

If you do NOT furnish a(n) ________, an automatic memberwise copy will be performed when one object is assigned to another object.

overloaded assignment operator

C++ requires that a copy constructor's parameter be a(n)

reference object

In C++11 reference variables that can refer only to temporary objects that would otherwise have no name are called ________ and are declared with a ________.

rvalues, double ampersand (&&)

A reason to overload the ________ is to allow you to write classes that have array-like behaviors.

square brackets [ ] operator

C++ allows you to redefine the way ________ work when used with class objects.

standard operators

A(n) ________ is a special built-in pointer that is available to a class's member functions.

this pointer

A good reason to overload an operator is to enable it to

work in its usual way, but with programmer-defined data types


Related study sets

organs of the digestive system: matching

View Set

Principles of Marketing Final Exam Study Guide

View Set

Pre Calculus: Trigonometric functions

View Set

Legal and Ethical Environment (test 2)

View Set

Bones and Muscles of Head and Neck

View Set

korean consonants (basic form) pronunciation without spelling

View Set