Click here to start
Table of contents
8
Slide 2
OBJECTIVES
Slide 4
8.1 Introduction
8.2 Pointer Variable Declarations and Initialization
8.2 Pointer Variable Declarations and Initialization (Cont.)
Common Programming Error 8.1
Good Programming Practice 8.1
Fig. 8.1 | Directly and indirectly referencing a variable.
Error-Prevention Tip 8.1
8.3 Pointer Operators
Fig. 8.2 | Graphical representation of a pointer pointing to a variable in memory.
8.3 Pointer Operators (Cont.)
Fig. 8.3 | Representation of y and yPtr in memory.
Common Programming Error 8.2
Common Programming Error 8.3
Common Programming Error 8.4
Portability Tip 8.1
Outline
Slide 21
Fig. 8.5 | Operator precedence and associativity.
8.4 Passing Arguments to Functions by Reference with Pointers
8.4 Passing Arguments to Functions by Reference with Pointers (Cont.)
Slide 25
Common Programming Error 8.5
Slide 27
Software Engineering Observation 8.1
Fig. 8.8 | Pass-by-value analysis of the program of Fig. 8.6.
Fig. 8.9 | Pass-by-reference analysis (with a pointer argument) of the program of Fig. 8.7.
8.5 Using const with Pointers
Portability Tip 8.2
Software Engineering Observation 8.2
Error-Prevention Tip 8.2
8.5 Using const with Pointers (Cont.)
Slide 36
Slide 37
Slide 38
Slide 39
Slide 40
Slide 41
Performance Tip 8.1
Software Engineering Observation 8.3
Slide 44
Slide 45
Common Programming Error 8.6
Slide 47
Slide 48
Slide 49
8.6 Selection Sort Using Pass-by-Reference
Slide 51
Slide 52
Slide 53
Software Engineering Observation 8.4
8.7 sizeof Operators
Common Programming Error 8.7
Slide 57
8.7 sizeof Operators (Cont.)
Slide 59
Slide 60
Portability Tip 8.3
Common Programming Error 8.8
Performance Tip 8.2
Error-Prevention Tip 8.3
8.8 Pointer Expressions and Pointer Arithmetic
8.8 Pointer Expressions and Pointer Arithmetic (Cont.)
Portability Tip 8.4
Fig. 8.18 | Array v and a pointer variable vPtr that points to v.
Fig. 8.19 | Pointer vPtr after pointer arithmetic.
Common Programming Error 8.9
Common Programming Error 8.10
Common Programming Error 8.11
Slide 73
Software Engineering Observation 8.5
Common Programming Error 8.12
Common Programming Error 8.13
Slide 77
8.9 Relationship Between Pointers and Arrays
8.9 Relationship Between Pointers and Arrays (Cont.)
Common Programming Error 8.14
Good Programming Practice 8.2
Slide 82
Slide 83
Slide 84
Slide 85
Slide 86
8.10 Arrays of Pointers
Fig. 8.22 | Graphical representation of the suit array.
8.11 Case Study: Card Shuffling and Dealing Simulation
Fig. 8.23 | Two-dimensional array representation of a deck of cards.
Performance Tip 8.3
8.11 Case Study: Card Shuffling and Dealing Simulation (Cont.)
Slide 93
Slide 94
Slide 95
Slide 96
Slide 97
Slide 98
Slide 99
Slide 100
8.12 Function Pointers
8.12 Function Pointers (Cont.)
Slide 103
Slide 104
Slide 105
Slide 106
Slide 107
Slide 108
Slide 109
Slide 110
8.13 Introduction to Pointer-Based String Processing
8.13.1 Fundamentals of Characters and Pointer-Based Strings
8.13.1 Fundamentals of Characters and Pointer-Based Strings (Cont.)
Slide 114
Common Programming Error 8.15
Common Programming Error 8.16
Error-Prevention Tip 8.4
Slide 118
Slide 119
Common Programming Error 8.17
Common Programming Error 8.18
8.13.2 String Manipulation Functions of the String-Handling Library
Fig. 8.30 | String-manipulation functions of the string-handling library. (Part 1 of 2)
Fig. 8.30 | String-manipulation functions of the string-handling library. (Part 2 of 2)
Common Programming Error 8.19
8.13.2 String Manipulation Functions of the String-Handling Library (Cont.)
Common Programming Error 8.20
Slide 128
Slide 129
Slide 130
Slide 131
Slide 132
Slide 133
Common Programming Error 8.21
Slide 135
Slide 136
Slide 137
Portability Tip 8.5
Portability Tip 8.6
Slide 140
Slide 141
Slide 142
Slide 143
Common Programming Error 8.22
Slide 145
Slide 146
Author:
Dr. J
E-mail:
Juliano@csuChico.edu
Homepage:
http://www.ecst.csuchico.edu/~juliano