Addison Wesley - Algorithms, Data Structures, and Problem Solving with C++.pdf

(1130 KB) Pobierz
63345625 UNPDF
Copyright
Ó
1996 by Addison-Wesley Publishing Company
1
Chapter 1
Pointers, Arrays, and Structures
63345625.008.png
Copyright
1996 by Addison-Wesley Publishing Company
2
(&X) 1000
X = 5
(&Y) 1004
Y = 7
5
Ptr
X
(&Ptr) 1200
1000
Pointer illustration
Ó
63345625.009.png 63345625.010.png
Copyright
1996 by Addison-Wesley Publishing Company
3
(&X) 1000
X = 10
(&Y) 1004
Y = 7
10
Ptr
X
(&Ptr) 1200
Ptr = &X = 1000
Result of *Ptr=10
Ó
63345625.011.png 63345625.001.png
Copyright
1996 by Addison-Wesley Publishing Company
4
(&X) 1000
X = 5
(&Y) 1004
Y = 7
5
Ptr
X
(&Ptr) 1200
Ptr = ?
Uninitialized pointer
Ó
63345625.002.png 63345625.003.png 63345625.004.png
Copyright
Ó
1996 by Addison-Wesley Publishing Company
5
5
5
Ptr1
X
Ptr1
X
Ptr1
7
7
Ptr2
Y
Ptr2
Y
Ptr2
(a)
(b)
(a) Initial state; (b) Ptr1=Ptr2 starting from initial state;
(c) *Ptr1=*Ptr2 starting from initial state
63345625.005.png 63345625.006.png 63345625.007.png
Zgłoś jeśli naruszono regulamin