|
|
CS 218 - Object Oriented Programming with C++
Review for Third Test
Students should review the self tests for all chapters covered so far:
chapter
11,
chapter
12,
chapter
13, chapter
14, and chapter
15 on the textbook author's web site. Each time you ask for a self
test, you should get 20 random review questions for a chapter. Review
each of them several times.
The questions below also provide review for this material. Please review them as well.
- What is a struct? How is it created?
- How is a struct like an array? How is it different?
- How do you assign a value to a member of a struct?
- What is the member access operator?
- How do you compare the values of two variable of the same struct type?
- What are the components of a struct called? What are the components
of a class called?
- How do declare a variable of a struct type?
- What do you call a class object that is created inside a function,
and that is destroyed when the function ends?
- What do you call a class object that is not destroyed until the program
it is in ends?
- What is the reserved word that prevents a function from changing a
variable that is passed to it by reference?
- What is the scope resolution operator? How is it used?
- What is a class constructor? What is a class destructor? How many
of each may a class have?
- What are public and private members? Which is the default for a class?
Which is the default for a struct?
- What kinds of inheritance does C++ support?
- What are classes called that inherit from other classes? What are
classes called that other classes are created from?
- What are the three memberAccessSpecifiers?
- If a base class has public members, how is this reflected in public
inheritance by derived classes? How are protected members affected?
- If a base class has public members, how is this reflected in private
inheritance by derived classes? How are protected members affected?
- If a base class has public members, how is this reflected in protected
inheritance by derived classes? How are protected members affected?
- How are private members treated, regardless of the memberAccessSpecifier?
- What is the difference between redefining and overloading an inherited
function?
- What is the syntax for creating a variable that is a pointer to int?
What is the syntax for creating two such variables in the same declaration?
- By default, what operations are allowed on pointer variables?
- Why is it accurate to describe the name of an array as a constant
pointer?
- What is the syntax for a function header that allows it to receive
a pointer by reference?
- Which members of a base class can a derived class never directly access?
- What does it mean to override a base class member function? What
does it mean to redefine it? What does it mean to overload it?
- How do you call a function in a base class if it is overridden in
the derived class?
- What is the data type of a pointer? Explain your answer.
- What is the address of operator? What is the dereferncing operator?
- If we have a pointer on the left side of an equal sign, there could
be one of four things on the right side of that equal sign. What are
they?
- Assume a pointer called ptr. What are the possible meanings of:
- What operator is used to create a dynamic variable? What operator
is used to destroy it? What is the operand of such a command?
- What are some unusual features about dynamic arrays?
- What is a shallow copy? What is a deep copy? How could something
go wrong with each of those situations?
- Students should review the code examples online and in the text, making
sure to understand them. There will be code questions on the test.
- What operator is used to overload existing operators in C++?
- What are the operators we are told cannot be overloaded?
- What is the name of the hidden pointer class objects maintain that
points to themselves?
- How do you declare a friend function to a class? Is it a member of
the class?
- If we overload some operators for a class, the overloading function
must be a member of the class. What operators is this true for?
- What built in operators can be used on classes? What operators can
be used on structs?
|