Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
29 Cards in this Set
- Front
- Back
A characteristic of operator overloading is |
giving new meanings to c++ operators |
|
An overloaded operator always requires ______ its number of operands |
One less argument than |
|
Assume a class C exists with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, the overloaded - operator must |
return a value |
|
How many arguments are required in the definition of a unary operator |
none |
|
Of the following C++ operators, which can be overloaded |
>= |
|
Operator overloading also allows the programmers to |
make c++ operators work with objects |
|
the compiler won't object if you overload the _____ operator to perform division, but it will be difficult for humans to understand |
- * + |
|
To convert from a basic type to a user-defined class, you would most likely use |
a one-argument constructor |
|
When you overload an arithmetic operator, the result |
goes in the object to the left of the operator |
|
A copy constructor is invoked when |
an argument is passed by value |
|
A friend function can be used to |
allow access to an unrelated class |
|
A pure virtual function is a function that |
is used in a base class |
|
A static function |
can be called using the class name and function name |
|
An abstract class is useful when |
no objects should be instantiated from it |
|
An assignment operator might be overloaded for all of the reasons exept |
ensure that all member data is copied exactly |
|
the keyword friend appears in all of the following except |
the class desiring access to another class |
|
the lifetime of a variable that is |
local to a member function coincides with the lifetime of the function |
|
the operation of the assignment operator and that of the copy constructor are |
similar, except that the copy constructor creates a new object |
|
Virtual functions allow you to |
use the same function call to execute member functions of objects from different classes |
|
A C++ stream is |
a flow of data from one place to another |
|
the base class for most stream classes is the _____ class |
ios |
|
All of the following are stream classes commonly used for disk I/O except |
sstream |
|
Some streams work with input, some with output |
True |
|
We can output text to an object of class ofstream using the insertion operator << because |
the insertion operator is overloaded in ofstream |
|
To write data that contains variables of type float to an object of type ofstream, you should use |
write() |
|
Mode bits such as app and ate accomplish all of the following except |
work with the put() and get() functions |
|
A file pointer always contains the address of the file |
False |
|
The statement f1.write((char)&obj1, sizeof(obj1)); |
writes the data in obj1 to f1 |
|
Command-line arguments are |
accessed through arguments to main() |