Please enable JavaScript.
Coggle requires JavaScript to display documents.
MM06 - Coggle Diagram
MM06
More About Pointers
Pointers to Pointers
Array of pointers - Dynamic Alloc.
Func. expects array of pointers
Variable number of Args.
Acess:
The arg pointer must be declared
Pointers to Functions
Allows complex declarations
Allows defining typenames
Change the name of established types
"typedef"
Improves readability
Dynamic Members
Data members of variable length
Dynamic Members of a Class
Important for classes representing arrays
Utilizing "constructors" and "destructors"
Copy constructor
If not specified, compiler uses default
Must avoid self assignment
DMA - Dynamic Memory Allocation
Allocating while running
Can be released when specified
More optimized
More Flexible
Enables use of
Dynamic Data Structs
Linked Lists
Memory only allocated when needed
Only need to move a pointer to manip. the linked list
Represented with
Recursive Data Struct.
"new" allocates memory
Returns a pointer
If no memory = Exception
On older compilers, no memory = return NULL pointer
"delete" releases memory
Objects created by "new" will not be deleted from memory until "delete" is called
No need to check NULL pointers
"delete" is a void type
Improper use can kill the program
"new" & "delete" - "constructors" & "destructors"
Only works with dynamic objects
Allows creation of dynamic arrays