Textbook Notes (280,000)
CA (170,000)
UTSG (10,000)
ECE (80)
Chapter 13

ECE244H1 Chapter Notes - Chapter 13: Member Variable

Electrical and Computer Engineering
Course Code
Tarek Abdelrahman

This preview shows half of the first page. to view the full 3 pages of the document.
ECE244 Chapter 13 Review
< Ch13.1 Nodes and Link Lists >
Operator ->
- Combines the action of a dereferencing operator * and a dot operator to specify a
member of dynamic struct or object that is pointed to by a given pointer
Syntax: pointer_name -> member_name
What’s the use of NULL?
1. Give a value to a pointer variable that otherwise would not have a value
- Prevents inadvertent reference to memory (NULL is not the address of any
memory location)
2. End marker
- Marks the end of a link list
What is nullptr?
- Special constant value that is used in the same way as NULL
- Can only be assigned to a pointer
- Is not the number 0
What is a link list?
- List of nodes which each node has a member variable that is a pointer that points to
the next node in the list
- Last node has NULL as the value of its member pointer variable
What is an empty link list?
- List with nothing
- Make head = NULL
Types of link list:
1. Inserting a node at the head of the list
- Use new
operator to create a new node
- Always keep one pointer variable pointing to the head of link list
You're Reading a Preview

Unlock to view full version