(Chapter 9.8 cfw_I39 518) Dynamic Memory
. We can allocate storage for data while the
program is running.
. new Operator
. Returns the address of the first byte of the new
m Redefining Base Class
. A method is said to be redefined in a derived
class when it has the same name (and perhaps
parameter list) as a method in the base class.
- This is not the same thing as overloading.
. Base c
Classes and Objects Introduction
. Procedural (structured) Programming
- Concerned with processes (actions) that occur in a
. Object-Oriented Programming (OOP)
- Focuses on the data (things) and the functions that
operate on it. OOP Concep
(Ch 16) Exceptions
. Used to communicate that something unexpected
- Allows the programmer to deal with unexpected
situations in a controlled manner.
. May be as simple or as complex as desired
(depending on usage in the program)
Objects (Chapter 13) Specication and
. Header files( .11 ) place class specification here
- Implementation file ( .cpp) implement methods
. The #include directive with a path
. Implementation ( . Cpp) files can be compiled;
and Function Pointers Instance and Static
. Normal members of a class are called instance
members. Each object has its own copy.
. Members may also be declared static.
- Static Attributes: Only one memory location is allocated
(Ch 17) The Linked List ADT
. Linked list: set of data structures (nodes) that
contain references to other data structures
i Relationship is linear: Each node references the next
node (and sometimes the previous node).
. References may be add
C52124 DoublyLinked List
A doubly-linked list is a linked list in which the nodes
support access to both the next and previous items
in the list, allowing bidirectional traversal. A DoublyLinked
ObJECtS Ag 9 re 9 at I o n
. Aggregation: an object of one class is used as an
attribute in another class
- Sometimes called composition
. Creates the "has a" relationship.
Large book example in Chapter 14 Instructor
Textbook Course Exampl
Operator Overloading Friends of Classes
. A function or class may be declared to be a
friend of a new class.
- Created by adding the friend type modifier to the front
of a declaration/prototype.
- Declaring a function or