Shared Flashcard Set

Details

Chapter 14
C++ Back of the Book Questions
28
Computer Science
Undergraduate 2
12/08/2012

Additional Computer Science Flashcards

 


 

Cards

Term
If a member variable is declared ________, all objects of that class have access to the same variable.
Definition
Static
Term
Static member variables are defined ________ the class.
Definition
Outside
Term
A(n) ________ member function cannot access any nonstatic member variables in its own class.
Definition
Static
Term
A static member function may be called _______ any instances of its class are defined.
Definition
Before
Term
A(n) ________ function is not a member of the class, but has access to the private members of the class.
Definition
Friend
Term
A(n) _______ tell the compiler that a specific class will be declared later in the function.
Definition
Forward declaration
Term
________ is the default behavior when an object is assigned the value of another object of the same class.
Definition
Memberwise assignment
Term
A(n) ________ is a special constructor, called whenever a new object is initialized with another object's data.
Definition
Copy Constructor
Term
_______ is a special built in pointer that is automatically passed as a hidden argument to all nonstatic member functions.
Definition
This
Term
An operator may be _______ to work with a specific class.
Definition
Overloaded
Term
When overloading the ________ operator, its function must have a dummy parameter.
Definition
Postfix increment (or decrement)
Term
Making an instance of one class a member of another class is called ________.
Definition
Aggregation
Term
Object aggregation is useful for creating a(n) ________ relationship between two classes.
Definition
Has a
Term
Static variables cannot be accessed by nonstatic member functions. t/f
Definition
TRUE
Term
Static member variables are defined outside their class declaration. t/f
Definition
TRUE
Term
A static member function may refer to nonstatic member variables of the same class, but only after an instance of the class has been defined. t/f
Definition
FALSE
Term
When a function is declared a friend by a class, it becomes a member of the class. t/f
Definition
FALSE
Term
A friend has access to the private members of the class declaring it a friend. t/f
Definition
TRUE
Term
an entire class may be declared a friend of another class. t/f
Definition
TRUE
Term
In order for a function or a class to become a friend of another class, it must be declared as such by the class granting it access. t/f
Definition
TRUE
Term
If a class has a pointer as a member, it's a good idea to also have a copy constructor. t/f
Definition
TRUE
Term
You cannot use the = operator to assign one object's values to another object, unless you overload the operator. t/f
Definition
FALSE
Term
If a class doesn't have a copy constructor, the compiler generates a default copy constructor for it. t/f
Definition
TRUE
Term
If a class has a copy constructor, and an object of that class is passed by value into a function, the function's parameter will not call its copy constructor. t/f
Definition
FALSE
Term
The "this" pointer is passed to static member functions. t/f
Definition
FALSE
Term
All functions that overload unary operators must have a dummy parameter. t/f
Definition
FALSE
Term
For an object to perform automatic type conversion, an operator function must be written. t/f
Definition
TRUE
Term
It is possible to have an instance of one class as a member of another class. t/f
Definition
TRUE
Supporting users have an ad free experience!