source: public/doc/gnu-c/Statements.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>Statements (GNU C Language Manual)</title>
23
24<meta name="description" content="Statements (GNU C Language Manual)">
25<meta name="keywords" content="Statements (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="Expression-Statement.html" rel="next" title="Expression Statement">
34<link href="Defining-Typedef-Names.html" rel="prev" title="Defining Typedef Names">
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="Statements"></span><div class="header">
59<p>
60Next: <a href="Variables.html" accesskey="n" rel="next">Variables</a>, Previous: <a href="Defining-Typedef-Names.html" accesskey="p" rel="prev">Defining Typedef Names</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="Statements-1"></span><h2 class="chapter">19 Statements</h2>
64<span id="index-statements"></span>
65
66<p>A <em>statement</em> specifies computations to be done for effect; it
67does not produce a value, as an expression would. In general a
68statement ends with a semicolon (&lsquo;<samp>;</samp>&rsquo;), but blocks (which are
69statements, more or less) are an exception to that rule.
70See <a href="Blocks.html">Blocks</a>.
71</p>
72<p>The places to use statements are inside a block, and inside a
73complex statement. A <em>complex statement</em> contains one or two
74components that are nested statements. Each such component must
75consist of one and only one statement. The way to put multiple
76statements in such a component is to group them into a <em>block</em>
77(see <a href="Blocks.html">Blocks</a>), which counts as one statement.
78</p>
79<p>The following sections describe the various kinds of statement.
80</p>
81<table class="menu" border="0" cellspacing="0">
82<tr><td align="left" valign="top">&bull; <a href="Expression-Statement.html" accesskey="1">Expression Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Evaluate an expression, as a statement,
83 usually done for a side effect.
84</td></tr>
85<tr><td align="left" valign="top">&bull; <a href="if-Statement.html" accesskey="2">if Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Basic conditional execution.
86</td></tr>
87<tr><td align="left" valign="top">&bull; <a href="if_002delse-Statement.html" accesskey="3">if-else Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Multiple branches for conditional execution.
88</td></tr>
89<tr><td align="left" valign="top">&bull; <a href="Blocks.html" accesskey="4">Blocks</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Grouping multiple statements together.
90</td></tr>
91<tr><td align="left" valign="top">&bull; <a href="return-Statement.html" accesskey="5">return Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Return a value from a function.
92</td></tr>
93<tr><td align="left" valign="top">&bull; <a href="Loop-Statements.html" accesskey="6">Loop Statements</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Repeatedly executing a statement or block.
94</td></tr>
95<tr><td align="left" valign="top">&bull; <a href="switch-Statement.html" accesskey="7">switch Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Multi-way conditional choices.
96</td></tr>
97<tr><td align="left" valign="top">&bull; <a href="switch-Example.html" accesskey="8">switch Example</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A plausible example of using <code>switch</code>.
98</td></tr>
99<tr><td align="left" valign="top">&bull; <a href="Duffs-Device.html" accesskey="9">Duffs Device</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A special way to use <code>switch</code>.
100</td></tr>
101<tr><td align="left" valign="top">&bull; <a href="Case-Ranges.html">Case Ranges</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Ranges of values for <code>switch</code> cases.
102</td></tr>
103<tr><td align="left" valign="top">&bull; <a href="Null-Statement.html">Null Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A statement that does nothing.
104</td></tr>
105<tr><td align="left" valign="top">&bull; <a href="goto-Statement.html">goto Statement</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Jump to another point in the source code,
106 identified by a label.
107</td></tr>
108<tr><td align="left" valign="top">&bull; <a href="Local-Labels.html">Local Labels</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Labels with limited scope.
109</td></tr>
110<tr><td align="left" valign="top">&bull; <a href="Labels-as-Values.html">Labels as Values</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Getting the address of a label.
111</td></tr>
112<tr><td align="left" valign="top">&bull; <a href="Statement-Exprs.html">Statement Exprs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A series of statements used as an expression.
113</td></tr>
114</table>
115
116<hr>
117<div class="header">
118<p>
119Next: <a href="Variables.html" accesskey="n" rel="next">Variables</a>, Previous: <a href="Defining-Typedef-Names.html" accesskey="p" rel="prev">Defining Typedef Names</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>
120</div>
121
122
123
124</body>
125</html>
Note: See TracBrowser for help on using the repository browser.