* better
[mascara-docs.git] / lang / C / the.ansi.c.programming.language / notes.accompany.ansi.c / sx8.html
blobec4caef6e8393f6ed242b666a7f736ac0cb27679
1 <!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
2 <!-- This collection of hypertext pages is Copyright 1995, 1996 by Steve Summit. -->
3 <!-- This material may be freely redistributed and used -->
4 <!-- but may not be republished or sold without permission. -->
5 <html>
6 <head>
7 <link rev="owner" href="mailto:scs@eskimo.com">
8 <link rev="made" href="mailto:scs@eskimo.com">
9 <title>Chapter 5: Pointers and Arrays</title>
10 <link href="sx7n.html" rev=precedes>
11 <link href="sx8a.html" rel=precedes>
12 <link href="top.html" rev=subdocument>
13 </head>
14 <body>
15 <H1>Chapter 5: Pointers and Arrays</H1>
17 <p>page 93
18 </p><p>Pointers are often thought to be the most difficult aspect of C.
19 It's true that many people have various problems with pointers,
20 and that many programs founder on pointer-related bugs.
21 Actually,
22 though,
23 many of the problems are not so much with the pointers <I>per se</I>
24 but rather with the memory they point to,
25 and more specifically,
26 when there <em>isn't</em> any valid memory which they point to.
27 As long as you're careful to ensure that the pointers in your
28 programs always point to valid memory,
29 pointers can be useful, powerful, and relatively trouble-free tools.
30 (In these notes,
31 we'll be emphasizing techniques for ensuring that pointers
32 always point where they should.)
33 </p><p>If you haven't worked with pointers before,
34 they're bound to be a bit baffling at first.
35 Rather than attempting a complete definition
36 (which probably wouldn't mean anything, either)
37 up front,
38 I'll ask you to read along for a few pages,
39 withholding judgment,
40 and after we've seen a few of the things that pointers can <em>do</em>,
41 we'll be in a better position to appreciate what they <em>are</em>.
42 </p><p><a href="sx8a.html" rel=subdocument>section 5.1: Pointers and Addresses</a></p>
43 <p><a href="sx8b.html" rel=subdocument>section 5.2: Pointers and Function Arguments</a></p>
44 <p><a href="sx8c.html" rel=subdocument>section 5.3: Pointers and Arrays</a></p>
45 <p><a href="sx8d.html" rel=subdocument>section 5.4: Address Arithmetic</a></p>
46 <p><a href="sx8e.html" rel=subdocument>section 5.5: Character Pointers and Functions</a></p>
47 <p><a href="sx8f.html" rel=subdocument>section 5.6: Pointer Arrays; Pointers to Pointers</a></p>
48 <p><a href="sx8g.html" rel=subdocument>section 5.7: Multi-dimensional Arrays</a></p>
49 <p><a href="sx8h.html" rel=subdocument>section 5.8: Initialization of Pointer Arrays</a></p>
50 <p><a href="sx8i.html" rel=subdocument>section 5.9: Pointers vs. Multi-dimensional Arrays</a></p>
51 <p><a href="sx8j.html" rel=subdocument>section 5.10: Command-line Arguments</a></p>
52 <hr>
53 <p>
54 Read sequentially:
55 <a href="sx7n.html" rev=precedes>prev</a>
56 <a href="sx8a.html" rel=precedes>next</a>
57 <a href="top.html" rev=subdocument>up</a>
58 <a href="top.html">top</a>
59 </p>
60 <p>
61 This page by <a href="http://www.eskimo.com/~scs/">Steve Summit</a>
62 // <a href="copyright.html">Copyright</a> 1995, 1996
63 // <a href="mailto:scs@eskimo.com">mail feedback</a>
64 </p>
65 </body>
66 </html>