source: public/doc/gnu-c/Pointers.html@ 02598c2

Last change on this file since 02598c2 was 02598c2, checked in by Mikhail Kirillov <w96k@…>, on Oct 6, 2022 at 12:36:29 PM

Add gnu-c

  • Property mode set to 100644
File size: 7.3 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Copyright (C) 2022 Richard Stallman and Free Software Foundation, Inc.
4
5(The work of Trevis Rothwell and Nelson Beebe has been assigned or
6licensed to the FSF.)
7
8Permission is granted to copy, distribute and/or modify this document
9under the terms of the GNU Free Documentation License, Version 1.3 or
10any later version published by the Free Software Foundation; with the
11Invariant Sections being "GNU General Public License," with the
12Front-Cover Texts being "A GNU Manual," and with the Back-Cover
13Texts as in (a) below. A copy of the license is included in the
14section entitled "GNU Free Documentation License."
15
16(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
17modify this GNU manual. Buying copies from the FSF supports it in
18developing GNU and promoting software freedom." -->
19<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
20<head>
21<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22<title>Pointers (GNU C Language Manual)</title>
23
24<meta name="description" content="Pointers (GNU C Language Manual)">
25<meta name="keywords" content="Pointers (GNU C Language Manual)">
26<meta name="resource-type" content="document">
27<meta name="distribution" content="global">
28<meta name="Generator" content="makeinfo">
29<link href="index.html" rel="start" title="Top">
30<link href="Symbol-Index.html" rel="index" title="Symbol Index">
31<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
32<link href="index.html" rel="up" title="Top">
33<link href="Address-of-Data.html" rel="next" title="Address of Data">
34<link href="Type-Size.html" rel="prev" title="Type Size">
35<style type="text/css">
36<!--
37a.summary-letter {text-decoration: none}
38blockquote.indentedblock {margin-right: 0em}
39div.display {margin-left: 3.2em}
40div.example {margin-left: 3.2em}
41div.lisp {margin-left: 3.2em}
42kbd {font-style: oblique}
43pre.display {font-family: inherit}
44pre.format {font-family: inherit}
45pre.menu-comment {font-family: serif}
46pre.menu-preformatted {font-family: serif}
47span.nolinebreak {white-space: nowrap}
48span.roman {font-family: initial; font-weight: normal}
49span.sansserif {font-family: sans-serif; font-weight: normal}
50ul.no-bullet {list-style: none}
51-->
52</style>
53
54
55</head>
56
57<body lang="en">
58<span id="Pointers"></span><div class="header">
59<p>
60Next: <a href="Structures.html" accesskey="n" rel="next">Structures</a>, Previous: <a href="Type-Size.html" accesskey="p" rel="prev">Type Size</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Index.html" title="Index" rel="index">Index</a>]</p>
61</div>
62<hr>
63<span id="Pointers-1"></span><h2 class="chapter">14 Pointers</h2>
64<span id="index-pointers"></span>
65
66<p>Among high-level languages, C is rather low level, close to the
67machine. This is mainly because it has explicit <em>pointers</em>. A
68pointer value is the numeric address of data in memory. The type of
69data to be found at that address is specified by the data type of the
70pointer itself. The unary operator &lsquo;<samp>*</samp>&rsquo; gets the data that a
71pointer points to&mdash;this is called <em>dereferencing the pointer</em>.
72</p>
73<p>C also allows pointers to functions, but since there are some
74differences in how they work, we treat them later. See <a href="Function-Pointers.html">Function Pointers</a>.
75</p>
76<table class="menu" border="0" cellspacing="0">
77<tr><td align="left" valign="top">&bull; <a href="Address-of-Data.html" accesskey="1">Address of Data</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Using the &ldquo;address-of&rdquo; operator.
78</td></tr>
79<tr><td align="left" valign="top">&bull; <a href="Pointer-Types.html" accesskey="2">Pointer Types</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">For each type, there is a pointer type.
80</td></tr>
81<tr><td align="left" valign="top">&bull; <a href="Pointer-Declarations.html" accesskey="3">Pointer Declarations</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Declaring variables with pointer types.
82</td></tr>
83<tr><td align="left" valign="top">&bull; <a href="Pointer-Type-Designators.html" accesskey="4">Pointer Type Designators</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Designators for pointer types.
84</td></tr>
85<tr><td align="left" valign="top">&bull; <a href="Pointer-Dereference.html" accesskey="5">Pointer Dereference</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Accessing what a pointer points at.
86</td></tr>
87<tr><td align="left" valign="top">&bull; <a href="Null-Pointers.html" accesskey="6">Null Pointers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Pointers which do not point to any object.
88</td></tr>
89<tr><td align="left" valign="top">&bull; <a href="Invalid-Dereference.html" accesskey="7">Invalid Dereference</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Dereferencing null or invalid pointers.
90</td></tr>
91<tr><td align="left" valign="top">&bull; <a href="Void-Pointers.html" accesskey="8">Void Pointers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Totally generic pointers, can cast to any.
92</td></tr>
93<tr><td align="left" valign="top">&bull; <a href="Pointer-Comparison.html" accesskey="9">Pointer Comparison</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Comparing memory address values.
94</td></tr>
95<tr><td align="left" valign="top">&bull; <a href="Pointer-Arithmetic.html">Pointer Arithmetic</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Computing memory address values.
96</td></tr>
97<tr><td align="left" valign="top">&bull; <a href="Pointers-and-Arrays.html">Pointers and Arrays</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Using pointer syntax instead of array syntax.
98</td></tr>
99<tr><td align="left" valign="top">&bull; <a href="Pointer-Arithmetic-Low-Level.html">Pointer Arithmetic Low Level</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">More about computing memory address values.
100</td></tr>
101<tr><td align="left" valign="top">&bull; <a href="Pointer-Increment_002fDecrement.html">Pointer Increment/Decrement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Incrementing and decrementing pointers.
102</td></tr>
103<tr><td align="left" valign="top">&bull; <a href="Pointer-Arithmetic-Drawbacks.html">Pointer Arithmetic Drawbacks</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A common pointer bug to watch out for.
104</td></tr>
105<tr><td align="left" valign="top">&bull; <a href="Pointer_002dInteger-Conversion.html">Pointer-Integer Conversion</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Converting pointer types to integer types.
106</td></tr>
107<tr><td align="left" valign="top">&bull; <a href="Printing-Pointers.html">Printing Pointers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Using <code>printf</code> for a pointer&rsquo;s value.
108</td></tr>
109</table>
110
111<hr>
112<div class="header">
113<p>
114Next: <a href="Structures.html" accesskey="n" rel="next">Structures</a>, Previous: <a href="Type-Size.html" accesskey="p" rel="prev">Type Size</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Index.html" title="Index" rel="index">Index</a>]</p>
115</div>
116
117
118
119</body>
120</html>
Note: See TracBrowser for help on using the repository browser.