unit 13 C++

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which of the following operators can be overloaded?

=

Which of the following statements is TRUE in operator overloading?

You cannot create the number of parameters an operator takes.

The return type of any function that overloads a relational operator is ____.

bool

A number of the form a + ib, in which i squared is -1 and a and b are real numbers, is called a _____ number.

complex

The syntax to declare the operator function operator[] as a member of a class for constant arrays is ____.

const Type& operator[](int index) const;

The general syntax to overload the assignment operator (=) for a class is ____.

const className& operator= (const className&);

An overloaded array index operator function needs ____.

constant and nonconstant versions

The ____ constructor is a function that converts its argument to an object of the constructor's class.

conversion

An operator function is a(n) ____ function.

value-returning

A _____ function of a class is a nonmember function of the class that has access to all of the members (public or non-public) of the class.

friend

The general syntax to overload the stream insertion operator, <<, is ____.

friend ostream& operator<<(ostream&, const className&);

A(n) ____ allows you to write a single code segment for a set of related functions.

function template

Classes with member pointer variables should ____.

include the copy constructor

When overloading unary operators, if the operator function is a nonmember of a class, it has ____ parameter(s).

one

A(n) ____ function is one that overloads an operator.

operator

Overloading a function refers to having several functions with the same name but different _____ lists.

parameter

Class templates are called ____, because based on the parameter type, a specific class is generated.

parameterized types

The general syntax of the heading of an operator function is ____.

returnType operator operatorSymbol (formal parameter list)

When using class templates, ____.

the function definition and client code are compiled together

Every object of a class maintains a hidden pointer to itself named ____.

this


Ensembles d'études connexes

LT #3: Solving Literal Equations

View Set

THREE PHASE MOTORS and ALTERNATORS

View Set

HESI Prep: Musculoskeletal system

View Set

Taxation of Life Insurance and Annuities

View Set

TLE: My Reading Text (Eggs - Kitchen Tools,Utensils & Equipment)

View Set

Professional Nursing NCLEX questions

View Set

gustatory receptors and the neural pathway for gustation

View Set