Chapter 14

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

A good reason for overloading an operator is to enable it to ________.

static

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

square brackets [ ] operator

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

TRUE

A static member variable can be used when there are no objects of the class in existence.

forward declaration

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

overloaded

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

FALSE

A public data member may be declared a friend of a private function.

"this" pointer

This is a special built-in pointer that is available to a class's member functions.

TRUE

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

standard operators

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

FALSE

C++ permits you to overload the sizeof operator and the this pointer.

reference object

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

member variables

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

static

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

A) copy constructor B) constructor C) destructor D) All of these

If you do not furnish one of these a default will be provided for you by the compiler.

overloaded assignment operator

If you do not furnish one of these, an automatic memberwise copy will be performed when one object is assigned to another object.

FALSE

If you overload the prefix ++ operator, the postfix ++ operator is automatically overloaded.

dummy parameter

In the following function header: FeetInches FeetInches::operator++(int) the word (int) is known as a(n):

constant, const

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

has a

Object composition is useful for creating this type of relationship between classes.

copy constructo

This is a special function that is called whenever a new object is created and initialized with another object's data.

=

This operator may be used to assign one object to another

friend

This type of function is not a member of a class, but it has access to the private members of the class.

static

This type of member variable may be accessed before any objects of the class have been created.

operator +

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

object composition

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

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.

copy constructor

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

TRUE

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

operands

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

FALSE

When you overload the << operator, you must also overload the >> operator.

overloaded

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


संबंधित स्टडी सेट्स

Visual Studio Code Keyboard Shortcuts

View Set

Flocabulary- Types of Government

View Set

(Chem 2) Quiz 1: Chapter 9 (Chemical Bonding: The Lewis Model)

View Set

Chapter 9 Production and Operation Management

View Set

opl 3 (the last quizlet i will ever make)

View Set

IM5 Assessment and Intervention Practice Questions

View Set