Week 6 Ch14

¡Supera tus tareas y exámenes ahora con Quizwiz!

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

copy constructor

If a member function is declared ____, all objects of that class have access to that variable a) static b) dynamic c) inline d) default e) None of these

static

This operator may be used to assign one object to another. a) = b) == c) <> d) NoT

=

If you do not furnish one of these, a default will be provided for you by the compiler a) copy constructor b) constructor c) destructor d) All of these e) None of these

All of these

It is a good idea to make a copy constructor's parameters ___ by specifying the ____ keyword in the parameter list a) inline, inline b) static, static c) constant, const d) global, global e) none of these

Constant, const

Each object of a class has its own copy of the class's a) member functions b) member variables c) constructor and destructor functions d) all of these e) none of these

Member variables

When a class contains an instance of another class it is known as a) object overloading b) operator overloading c) object composition d) dynamic composition e) NoT

Object composition

If you do not furnish one of these, an automatic member-wise copy will be performed when one object is assigned to another object a) overloaded constructor function b) overloaded assignment operator c) default constructor function d) overloaded copy operator e) None of these

Overloaded assignment operator

C++ allows you to redefine the way ____________ work when used with class objects a) compiler errors b) preprocessor directives c) standard operators d) undefined variables e) NoT

Standard Operators

This is a special built-in pointer that is available to a class's member functions. a) overloaded -> operator b) this pointer c) &constructor pointer d) NoT

This pointer

A reason to overload the ___ is to write classes that have array like behaviors a) () operator b) {} operator c) [] operator d) :: operator e) NoT

[] operator

When objects contain pointers, it is a good idea to create an explicit ____ function a) destructor b) copy constructor c) static constructor d) inline constructor e) None of these

copy constructor

This type of function is not a member of a class, but it has access to the private members of the class a) static b) constructor c) destructor d) friend e) none of these

friend

Object composition is useful for creating this type of relationship between classes. a) friend b) static c) has a d) conditional e) NoT

has a

When you overload an operator, you cannot change the number of ____ taken by the operator a) arguments b) parameters c) operations d) operands e) none of these

operands

To overload the + operator, you would write a function named: a) overload + b) operator + c) function + d) operator.overload(+) e) None of these

operator +

A(n) ________ operator can work with programmer-defined data types. a) inline b) unconditional c) overloaded d) undefined e) none of these

overloaded

When you redefine the way a standard operator works when it is used with class objects, you have ____________ the operator. a) reassigned b) reformatted c) overloaded d) overwhelmed e)None of these

overloaded

C++ requires that a copy constructor's parameter be a(n) a) integer data type b) floating point data type c) pointer variable d) reference object e) none of these

reference object

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

static

This type of member variable may be accessed before any objects of the class have been created. a) private b) public c) inline d) static e) None of these

static

A good reason for overloading an operator is to enable it to a) outperform its C language counterparts b) work in its usual way, but with programmer-defined data types c) operate on more operands than in its standard definition d) operate on no operands e) None of these

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


Conjuntos de estudio relacionados

Chapter 2: An agent's perception of riches

View Set

Gross Anatomy 1 (back muscles, week 1, 2, and 3)

View Set

Chapter 65: Management of Patients with Oncologic or Degenerative Neurologic Disorders

View Set