<s>
The	O
syntax	O
of	O
the	O
C	B-Language
programming	I-Language
language	I-Language
is	O
the	O
set	O
of	O
rules	O
governing	O
writing	O
of	O
software	O
in	O
the	O
C	B-Language
language	I-Language
.	O
</s>
<s>
It	O
is	O
designed	O
to	O
allow	O
for	O
programs	O
that	O
are	O
extremely	O
terse	O
,	O
have	O
a	O
close	O
relationship	O
with	O
the	O
resulting	O
object	B-Language
code	I-Language
,	O
and	O
yet	O
provide	O
relatively	O
high-level	O
data	B-Application
abstraction	I-Application
.	O
</s>
<s>
C	B-Language
was	O
the	O
first	O
widely	O
successful	O
high-level	O
language	O
for	O
portable	O
operating-system	B-General_Concept
development	O
.	O
</s>
<s>
C	B-Language
syntax	O
makes	O
use	O
of	O
the	O
maximal	B-Application
munch	I-Application
principle	O
.	O
</s>
<s>
The	O
C	B-Language
language	I-Language
represents	O
numbers	O
in	O
three	O
forms	O
:	O
integral	O
,	O
real	O
and	O
complex	O
.	O
</s>
<s>
This	O
distinction	O
reflects	O
similar	O
distinctions	O
in	O
the	O
instruction	B-General_Concept
set	I-General_Concept
architecture	I-General_Concept
of	O
most	O
central	B-General_Concept
processing	I-General_Concept
units	I-General_Concept
.	O
</s>
<s>
Integral	O
data	O
types	O
store	O
numbers	O
in	O
the	O
set	O
of	O
integers	O
,	O
while	O
real	O
and	O
complex	O
numbers	O
represent	O
numbers	O
(	O
or	O
pair	O
of	O
numbers	O
)	O
in	O
the	O
set	O
of	O
real	O
numbers	O
in	O
floating	B-Algorithm
point	I-Algorithm
form	O
.	O
</s>
<s>
All	O
C	B-Language
integer	O
types	O
have	O
and	O
variants	O
.	O
</s>
<s>
It	O
may	O
be	O
a	O
signed	O
type	O
or	O
an	O
unsigned	B-Algorithm
type	O
,	O
depending	O
on	O
the	O
compiler	B-Language
and	O
the	O
character	B-General_Concept
set	I-General_Concept
(	O
C	B-Language
guarantees	O
that	O
members	O
of	O
the	O
C	B-Language
basic	O
character	B-General_Concept
set	I-General_Concept
have	O
positive	O
values	O
)	O
.	O
</s>
<s>
Also	O
,	O
bit	O
field	O
types	O
specified	O
as	O
plain	O
may	O
be	O
signed	O
or	O
unsigned	B-Algorithm
,	O
depending	O
on	O
the	O
compiler	B-Language
.	O
</s>
<s>
C	B-Language
's	O
integer	O
types	O
come	O
in	O
different	O
fixed	O
sizes	O
,	O
capable	O
of	O
representing	O
various	O
ranges	O
of	O
numbers	O
.	O
</s>
<s>
The	O
type	O
occupies	O
exactly	O
one	O
byte	B-Application
(	O
the	O
smallest	O
addressable	O
storage	O
unit	O
)	O
,	O
which	O
is	O
typically	O
8	O
bits	O
wide	O
.	O
</s>
<s>
(	O
Although	O
can	O
represent	O
any	O
of	O
C	B-Language
's	O
"	O
basic	O
"	O
characters	O
,	O
a	O
wider	O
type	O
may	O
be	O
required	O
for	O
international	B-General_Concept
character	I-General_Concept
sets	I-General_Concept
.	O
)	O
</s>
<s>
Most	O
integer	O
types	O
have	O
both	O
signed	B-Algorithm
and	I-Algorithm
unsigned	I-Algorithm
varieties	O
,	O
designated	O
by	O
the	O
and	O
keywords	O
.	O
</s>
<s>
Signed	O
integer	O
types	O
may	O
use	O
a	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
,	O
ones	O
 '	O
complement	O
,	O
or	O
sign-and-magnitude	O
representation	B-Algorithm
.	O
</s>
<s>
The	O
representation	B-Algorithm
of	O
some	O
types	O
may	O
include	O
unused	O
"	O
padding	B-Application
"	O
bits	O
,	O
which	O
occupy	O
storage	O
but	O
are	O
not	O
included	O
in	O
the	O
width	O
.	O
</s>
<s>
+	O
Specifications	O
for	O
standard	O
integer	O
types	O
Shortest	O
form	O
of	O
specifier	O
Minimum	O
width	O
(	O
bits	O
)	O
1	O
8	O
8	O
8	O
16	O
16	O
16	O
16	O
32	O
32	O
The	O
modifier	O
was	O
introduced	O
in	O
the	O
C99	B-Language
standard	I-Language
.	O
</s>
<s>
The	O
type	O
is	O
distinct	O
from	O
both	O
and	O
,	O
but	O
is	O
guaranteed	O
to	O
have	O
the	O
same	O
representation	B-Algorithm
as	O
one	O
of	O
them	O
.	O
</s>
<s>
The	O
and	O
types	O
are	O
standardized	O
since	O
1999	O
,	O
and	O
may	O
not	O
be	O
supported	O
by	O
older	O
C	B-Language
compilers	B-Language
.	O
</s>
<s>
Type	O
is	O
usually	O
accessed	O
via	O
the	O
typedef	B-Language
name	O
defined	O
by	O
the	O
standard	B-Library
header	I-Library
stdbool.h.	O
</s>
<s>
In	O
general	O
,	O
the	O
widths	O
and	O
representation	B-Algorithm
scheme	O
implemented	O
for	O
any	O
given	O
platform	O
are	O
chosen	O
based	O
on	O
the	O
machine	O
architecture	O
,	O
with	O
some	O
consideration	O
given	O
to	O
the	O
ease	O
of	O
importing	O
source	O
code	O
developed	O
for	O
other	O
platforms	O
.	O
</s>
<s>
The	O
width	O
of	O
the	O
type	O
varies	O
especially	O
widely	O
among	O
C	B-Language
implementations	O
;	O
it	O
often	O
corresponds	O
to	O
the	O
most	O
"	O
natural	O
"	O
word	O
size	O
for	O
the	O
specific	O
platform	O
.	O
</s>
<s>
The	O
standard	B-Library
header	I-Library
limits.h	O
defines	O
macros	O
for	O
the	O
minimum	O
and	O
maximum	O
representable	O
values	O
of	O
the	O
standard	O
integer	O
types	O
as	O
implemented	O
on	O
any	O
specific	O
platform	O
.	O
</s>
<s>
In	O
addition	O
to	O
the	O
standard	O
integer	O
types	O
,	O
there	O
may	O
be	O
other	O
"	O
extended	O
"	O
integer	O
types	O
,	O
which	O
can	O
be	O
used	O
for	O
s	O
in	O
standard	B-Library
headers	I-Library
.	O
</s>
<s>
For	O
more	O
precise	O
specification	O
of	O
width	O
,	O
programmers	O
can	O
and	O
should	O
use	O
s	O
from	O
the	O
standard	B-Library
header	I-Library
stdint.h.	O
</s>
<s>
Numeric	B-Algorithm
values	O
can	O
be	O
specified	O
as	O
decimal	B-Application
(	O
example	O
:	O
)	O
,	O
octal	O
with	O
zero	O
(	O
0	O
)	O
as	O
a	O
prefix	O
(	O
)	O
,	O
or	O
hexadecimal	O
with	O
0x	O
(	O
zero	O
x	O
)	O
as	O
a	O
prefix	O
(	O
)	O
.	O
</s>
<s>
A	O
character	O
in	O
single	O
quotes	O
(	O
example	O
:	O
)	O
,	O
called	O
a	O
"	O
character	O
constant	O
,	O
"	O
represents	O
the	O
value	O
of	O
that	O
character	O
in	O
the	O
execution	O
character	B-General_Concept
set	I-General_Concept
,	O
with	O
type	O
.	O
</s>
<s>
This	O
can	O
be	O
overridden	O
by	O
appending	O
an	O
explicit	O
length	O
and/or	O
signedness	B-Algorithm
modifier	O
;	O
for	O
example	O
,	O
has	O
type	O
.	O
</s>
<s>
The	O
enumerated	B-Language
type	I-Language
in	O
C	B-Language
,	O
specified	O
with	O
the	O
keyword	O
,	O
and	O
often	O
just	O
called	O
an	O
"	O
enum	B-Language
"	O
(	O
usually	O
pronounced	O
ee'-num	O
/ˌi.nʌm/	O
or	O
ee'-noom	O
/ˌi.nuːm/	O
)	O
,	O
is	O
a	O
type	O
designed	O
to	O
represent	O
values	O
across	O
a	O
series	O
of	O
named	O
constants	O
.	O
</s>
<s>
Each	O
type	O
itself	O
is	O
compatible	O
with	O
or	O
a	O
signed	O
or	O
unsigned	B-Algorithm
integer	O
type	O
,	O
but	O
each	O
implementation	O
defines	O
its	O
own	O
rules	O
for	O
choosing	O
a	O
type	O
.	O
</s>
<s>
Some	O
compilers	B-Language
warn	O
if	O
an	O
object	O
with	O
enumerated	B-Language
type	I-Language
is	O
assigned	O
a	O
value	O
that	O
is	O
not	O
one	O
of	O
its	O
constants	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
values	O
are	O
often	O
used	O
in	O
place	O
of	O
preprocessor	B-Application
directives	O
to	O
create	O
named	O
constants	O
.	O
</s>
<s>
An	O
enumerated	B-Language
type	I-Language
is	O
declared	O
with	O
the	O
specifier	O
and	O
an	O
optional	O
name	O
(	O
or	O
tag	O
)	O
for	O
the	O
enum	B-Language
,	O
followed	O
by	O
a	O
list	O
of	O
one	O
or	O
more	O
constants	O
contained	O
within	O
curly	O
braces	O
and	O
separated	O
by	O
commas	O
,	O
and	O
an	O
optional	O
list	O
of	O
variable	O
names	O
.	O
</s>
<s>
Subsequent	O
references	O
to	O
a	O
specific	O
enumerated	B-Language
type	I-Language
use	O
the	O
keyword	O
and	O
the	O
name	O
of	O
the	O
enum	B-Language
.	O
</s>
<s>
By	O
default	O
,	O
the	O
first	O
constant	O
in	O
an	O
enumeration	B-Language
is	O
assigned	O
the	O
value	O
zero	O
,	O
and	O
each	O
subsequent	O
value	O
is	O
incremented	O
by	O
one	O
over	O
the	O
previous	O
constant	O
.	O
</s>
<s>
The	O
constants	O
may	O
be	O
used	O
outside	O
of	O
the	O
context	O
of	O
the	O
enum	B-Language
(	O
where	O
any	O
integer	O
value	O
is	O
allowed	O
)	O
,	O
and	O
values	O
other	O
than	O
the	O
constants	O
may	O
be	O
assigned	O
to	O
,	O
or	O
any	O
other	O
variable	O
of	O
type	O
.	O
</s>
<s>
The	O
floating-point	B-Algorithm
form	O
is	O
used	O
to	O
represent	O
numbers	O
with	O
a	O
fractional	O
component	O
.	O
</s>
<s>
Each	O
of	O
these	O
may	O
represent	O
values	O
in	O
a	O
different	O
form	O
,	O
often	O
one	O
of	O
the	O
IEEE	O
floating-point	B-Algorithm
formats	I-Algorithm
.	O
</s>
<s>
Floating-point	B-Algorithm
constants	O
may	O
be	O
written	O
in	O
decimal	B-Application
notation	O
,	O
e.g.	O
</s>
<s>
Decimal	B-Application
scientific	O
notation	O
may	O
be	O
used	O
by	O
adding	O
or	O
followed	O
by	O
a	O
decimal	B-Application
exponent	O
,	O
also	O
known	O
as	O
E	O
notation	O
,	O
e.g.	O
</s>
<s>
Either	O
a	O
decimal	B-Application
point	O
or	O
an	O
exponent	O
is	O
required	O
(	O
otherwise	O
,	O
the	O
number	O
is	O
parsed	O
as	O
an	O
integer	O
constant	O
)	O
.	O
</s>
<s>
Hexadecimal	O
floating-point	B-Algorithm
constants	O
follow	O
similar	O
rules	O
,	O
except	O
that	O
they	O
must	O
be	O
prefixed	O
by	O
and	O
use	O
or	O
to	O
specify	O
a	O
binary	O
exponent	O
,	O
e.g.	O
</s>
<s>
Both	O
decimal	B-Application
and	O
hexadecimal	O
floating-point	B-Algorithm
constants	O
may	O
be	O
suffixed	O
by	O
or	O
to	O
indicate	O
a	O
constant	O
of	O
type	O
,	O
by	O
(	O
letter	O
)	O
or	O
to	O
indicate	O
type	O
,	O
or	O
left	O
unsuffixed	O
for	O
a	O
constant	O
.	O
</s>
<s>
The	O
standard	B-Library
header	I-Library
file	O
defines	O
the	O
minimum	O
and	O
maximum	O
values	O
of	O
the	O
implementation	O
's	O
floating-point	B-Algorithm
types	O
,	O
,	O
and	O
.	O
</s>
<s>
It	O
also	O
defines	O
other	O
limits	O
that	O
are	O
relevant	O
to	O
the	O
processing	O
of	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
Variables	O
declared	O
within	O
a	O
block	O
by	O
default	O
have	O
automatic	O
storage	O
,	O
as	O
do	O
those	O
explicitly	O
declared	O
with	O
the	O
or	O
storage	B-Language
class	I-Language
specifiers	I-Language
.	O
</s>
<s>
Objects	O
declared	O
outside	O
of	O
all	O
blocks	O
and	O
those	O
explicitly	O
declared	O
with	O
the	O
storage	B-Language
class	I-Language
specifier	I-Language
have	O
static	O
storage	O
duration	O
.	O
</s>
<s>
Static	B-General_Concept
variables	I-General_Concept
are	O
initialized	O
to	O
zero	O
by	O
default	O
by	O
the	O
compiler	B-Language
.	O
</s>
<s>
Additionally	O
,	O
objects	O
declared	O
with	O
the	O
storage	O
class	O
may	O
be	O
given	O
higher	O
priority	O
by	O
the	O
compiler	B-Language
for	O
access	O
to	O
registers	B-General_Concept
;	O
although	O
the	O
compiler	B-Language
may	O
choose	O
not	O
to	O
actually	O
store	O
any	O
of	O
them	O
in	O
a	O
register	O
.	O
</s>
<s>
Objects	O
with	O
static	O
storage	O
persist	O
for	O
the	O
program	B-Application
's	O
entire	O
duration	O
.	O
</s>
<s>
The	O
storage	B-Language
class	I-Language
specifier	I-Language
indicates	O
that	O
the	O
storage	O
for	O
an	O
object	O
has	O
been	O
defined	O
elsewhere	O
.	O
</s>
<s>
When	O
used	O
outside	O
of	O
all	O
blocks	O
,	O
it	O
indicates	O
that	O
the	O
storage	O
has	O
been	O
defined	O
outside	O
of	O
the	O
compilation	B-Language
unit	O
.	O
</s>
<s>
The	O
storage	B-Language
class	I-Language
specifier	I-Language
is	O
redundant	O
when	O
used	O
on	O
a	O
function	O
declaration	O
.	O
</s>
<s>
It	O
indicates	O
that	O
the	O
declared	O
function	O
has	O
been	O
defined	O
outside	O
of	O
the	O
compilation	B-Language
unit	O
.	O
</s>
<s>
The	O
(	O
thread_local	O
in	O
C++	B-Language
,	O
since	O
C23	B-Language
,	O
and	O
in	O
earlier	O
versions	O
of	O
C	B-Language
if	O
the	O
header	O
<threads.h>	O
is	O
included	O
)	O
storage	B-Language
class	I-Language
specifier	I-Language
,	O
introduced	O
in	O
C11	O
,	O
is	O
used	O
to	O
declare	O
a	O
thread-local	O
variable	O
.	O
</s>
<s>
Note	O
that	O
storage	O
specifiers	O
apply	O
only	O
to	O
functions	O
and	O
objects	O
;	O
other	O
things	O
such	O
as	O
type	O
and	O
enum	B-Language
declarations	O
are	O
private	O
to	O
the	O
compilation	B-Language
unit	O
in	O
which	O
they	O
appear	O
.	O
</s>
<s>
Attempting	O
to	O
modify	O
a	O
const	O
qualified	O
value	O
yields	O
undefined	O
behavior	O
,	O
so	O
some	O
C	B-Language
compilers	B-Language
store	O
them	O
in	O
rodata	O
or	O
(	O
for	O
embedded	O
systems	O
)	O
in	O
read-only	B-Device
memory	I-Device
(	O
ROM	B-Device
)	O
.	O
</s>
<s>
The	O
type	O
qualifier	O
volatile	B-Operating_System
indicates	O
to	O
an	O
optimizing	B-Application
compiler	I-Application
that	O
it	O
may	O
not	O
remove	O
apparently	O
redundant	O
reads	O
or	O
writes	O
,	O
as	O
the	O
value	O
may	O
change	O
even	O
if	O
it	O
was	O
not	O
modified	O
by	O
any	O
expression	O
or	O
statement	O
,	O
or	O
multiple	O
writes	O
may	O
be	O
necessary	O
,	O
such	O
as	O
for	O
memory-mapped	B-Architecture
I/O	I-Architecture
.	O
</s>
<s>
Pointers	O
to	O
data	O
always	O
have	O
the	O
same	O
byte-width	O
regardless	O
of	O
what	O
they	O
point	O
to	O
,	O
so	O
this	O
statement	O
is	O
valid	O
by	O
itself	O
(	O
as	O
long	O
as	O
is	O
not	O
dereferenced	O
)	O
.	O
</s>
<s>
The	O
incomplete	O
type	O
can	O
be	O
completed	O
later	O
in	O
the	O
same	O
scope	B-Language
by	O
redeclaring	O
it	O
:	O
</s>
<s>
Incomplete	O
types	O
are	O
also	O
used	O
for	O
data	B-Application
hiding	I-Application
;	O
the	O
incomplete	O
type	O
is	O
defined	O
in	O
a	O
header	B-Language
file	I-Language
,	O
and	O
the	O
body	O
only	O
within	O
the	O
relevant	O
source	O
file	O
.	O
</s>
<s>
Arrays	O
are	O
used	O
in	O
C	B-Language
to	O
represent	O
structures	O
of	O
consecutive	O
elements	O
of	O
the	O
same	O
type	O
.	O
</s>
<s>
C	B-Language
provides	O
no	O
facility	O
for	O
automatic	O
bounds	B-Data_Structure
checking	I-Data_Structure
for	O
array	O
usage	O
.	O
</s>
<s>
C99	B-Language
standardised	O
variable-length	B-Data_Structure
arrays	I-Data_Structure
(	O
VLAs	O
)	O
within	O
block	O
scope	B-Language
.	O
</s>
<s>
As	O
of	O
C11	O
this	O
feature	O
is	O
no	O
longer	O
required	O
to	O
be	O
implemented	O
by	O
the	O
compiler	B-Language
.	O
</s>
<s>
Arrays	O
that	O
can	O
be	O
resized	O
dynamically	O
can	O
be	O
produced	O
with	O
the	O
help	O
of	O
the	B-Language
C	I-Language
standard	I-Language
library	I-Language
.	O
</s>
<s>
The	O
malloc	B-Language
function	O
provides	O
a	O
simple	O
method	O
for	O
allocating	O
memory	O
.	O
</s>
<s>
It	O
takes	O
one	O
parameter	O
:	O
the	O
amount	O
of	O
memory	O
to	O
allocate	O
in	O
bytes	B-Application
.	O
</s>
<s>
The	O
advantage	O
in	O
using	O
this	O
dynamic	B-Application
allocation	I-Application
is	O
that	O
the	O
amount	O
of	O
memory	O
that	O
is	O
allocated	O
to	O
it	O
can	O
be	O
limited	O
to	O
what	O
is	O
actually	O
needed	O
at	O
run	O
time	O
,	O
and	O
this	O
can	O
be	O
changed	O
as	O
needed	O
(	O
using	O
the	O
standard	B-Language
library	I-Language
function	O
)	O
.	O
</s>
<s>
This	O
ensures	O
that	O
further	O
attempts	O
to	O
dereference	O
the	O
pointer	O
,	O
on	O
most	O
systems	O
,	O
will	O
crash	O
the	O
program	B-Application
.	O
</s>
<s>
If	O
this	O
is	O
not	O
done	O
,	O
the	O
variable	O
becomes	O
a	O
dangling	B-Error_Name
pointer	I-Error_Name
which	O
can	O
lead	O
to	O
a	O
use-after-free	B-Error_Name
bug	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
pointer	O
is	O
a	O
local	O
variable	O
,	O
setting	O
it	O
to	O
does	O
not	O
prevent	O
the	O
program	B-Application
from	O
using	O
other	O
copies	O
of	O
the	O
pointer	O
.	O
</s>
<s>
Local	O
use-after-free	B-Error_Name
bugs	O
are	O
usually	O
easy	O
for	O
static	O
analyzers	O
to	O
recognize	O
.	O
</s>
<s>
Therefore	O
,	O
this	O
approach	O
is	O
less	O
useful	O
for	O
local	O
pointers	O
and	O
it	O
is	O
more	O
often	O
used	O
with	O
pointers	O
stored	O
in	O
long-living	O
structs	B-Language
.	O
</s>
<s>
In	O
general	O
though	O
,	O
setting	O
pointers	O
to	O
is	O
good	O
practice	O
as	O
it	O
allows	O
a	O
programmer	B-General_Concept
is	O
-check	O
pointers	O
prior	O
to	O
dereferencing	O
,	O
thus	O
helping	O
prevent	O
crashes	O
.	O
</s>
<s>
Recalling	O
the	O
array	O
example	O
,	O
one	O
could	O
also	O
create	O
a	O
fixed-size	O
array	O
through	O
dynamic	B-Application
allocation	I-Application
:	O
</s>
<s>
The	O
benefit	O
to	O
using	O
the	O
second	O
example	O
is	O
that	O
the	O
numeric	B-Algorithm
limit	O
of	O
the	O
first	O
example	O
is	O
n't	O
required	O
,	O
which	O
means	O
that	O
the	O
pointer-to-array	O
could	O
be	O
of	O
any	O
size	O
and	O
the	O
second	O
example	O
can	O
execute	O
without	O
any	O
modifications	O
.	O
</s>
<s>
In	O
addition	O
,	O
C	B-Language
supports	O
arrays	O
of	O
multiple	O
dimensions	O
,	O
which	O
are	O
stored	O
in	O
row-major	B-Data_Structure
order	I-Data_Structure
.	O
</s>
<s>
Technically	O
,	O
C	B-Language
multidimensional	O
arrays	O
are	O
just	O
one-dimensional	O
arrays	O
whose	O
elements	O
are	O
arrays	O
.	O
</s>
<s>
A	O
multidimensional	O
array	O
should	O
not	O
be	O
confused	O
with	O
an	O
array	O
of	O
pointers	O
to	O
arrays	O
(	O
also	O
known	O
as	O
an	O
Iliffe	B-Data_Structure
vector	I-Data_Structure
or	O
sometimes	O
an	O
array	O
of	O
arrays	O
)	O
.	O
</s>
<s>
In	O
C	B-Language
,	O
string	B-Language
literals	I-Language
are	O
surrounded	O
by	O
double	O
quotes	O
(	O
)	O
,	O
e.g.	O
</s>
<s>
and	O
are	O
compiled	B-Language
to	O
an	O
array	O
of	O
the	O
specified	O
values	O
with	O
an	O
additional	O
null	O
terminating	O
character	O
(	O
0-valued	O
)	O
code	O
to	O
mark	O
the	O
end	O
of	O
the	O
string	O
.	O
</s>
<s>
String	B-Language
literals	I-Language
may	O
not	O
contain	O
embedded	O
newlines	O
;	O
this	O
proscription	O
somewhat	O
simplifies	O
parsing	O
of	O
the	O
language	O
.	O
</s>
<s>
There	O
are	O
several	O
standard	B-Language
library	I-Language
functions	O
for	O
operating	O
with	O
string	O
data	O
(	O
not	O
necessarily	O
constant	O
)	O
organized	O
as	O
array	O
of	O
using	O
this	O
null-terminated	O
format	O
;	O
see	O
below	O
.	O
</s>
<s>
C	B-Language
's	O
string-literal	O
syntax	O
has	O
been	O
very	O
influential	O
,	O
and	O
has	O
made	O
its	O
way	O
into	O
many	O
other	O
languages	O
,	O
such	O
as	O
C++	B-Language
,	O
Objective-C	O
,	O
Perl	O
,	O
Python	O
,	O
PHP	O
,	O
Java	O
,	O
Javascript	O
,	O
C#	O
,	O
and	O
Ruby	O
.	O
</s>
<s>
Nowadays	O
,	O
almost	O
all	O
new	O
languages	O
adopt	O
or	O
build	O
upon	O
C-style	O
string	O
syntax	O
.	O
</s>
<s>
Languages	O
that	O
lack	O
this	O
syntax	O
tend	O
to	O
precede	O
C	B-Language
.	O
</s>
<s>
Because	O
certain	O
characters	O
cannot	O
be	O
part	O
of	O
a	O
literal	B-Language
string	I-Language
expression	O
directly	O
,	O
they	O
are	O
instead	O
identified	O
by	O
an	O
escape	O
sequence	O
starting	O
with	O
a	O
backslash	O
(	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
backslashes	O
in	O
indicate	O
(	O
to	O
the	O
compiler	B-Language
)	O
that	O
the	O
inner	O
pair	O
of	O
quotes	O
are	O
intended	O
as	O
an	O
actual	O
part	O
of	O
the	O
string	O
,	O
rather	O
than	O
the	O
default	O
reading	O
as	O
a	O
delimiter	O
(	O
endpoint	O
)	O
of	O
the	O
string	O
itself	O
.	O
</s>
<s>
The	O
use	O
of	O
other	O
backslash	O
escapes	O
is	O
not	O
defined	O
by	O
the	O
C	B-Language
standard	O
,	O
although	O
compiler	B-Language
vendors	O
often	O
provide	O
additional	O
escape	O
codes	O
as	O
language	O
extensions	O
.	O
</s>
<s>
One	O
of	O
these	O
is	O
the	O
escape	O
sequence	O
\e	B-Algorithm
for	O
the	O
escape	B-Algorithm
character	I-Algorithm
with	O
ASCII	O
hex	O
value	O
1B	O
which	O
was	O
not	O
added	O
to	O
the	O
C	B-Language
standard	O
due	O
to	O
lacking	O
representation	B-Algorithm
in	O
other	O
character	B-General_Concept
sets	I-General_Concept
(	O
such	O
as	O
EBCDIC	B-Language
)	O
.	O
</s>
<s>
It	O
is	O
available	O
in	O
GCC	B-Application
,	O
clang	B-Application
and	O
tcc	B-Language
.	O
</s>
<s>
C	B-Language
has	O
string	B-Language
literal	I-Language
concatenation	O
,	O
meaning	O
that	O
adjacent	O
string	B-Language
literals	I-Language
are	O
concatenated	O
at	O
compile	B-Language
time	O
;	O
this	O
allows	O
long	O
strings	O
to	O
be	O
split	O
over	O
multiple	O
lines	O
,	O
and	O
also	O
allows	O
string	B-Language
literals	I-Language
resulting	O
from	O
C	B-Language
preprocessor	I-Language
defines	O
and	O
macros	O
to	O
be	O
appended	O
to	O
strings	O
at	O
compile	B-Language
time	O
:	O
</s>
<s>
,	O
and	O
have	O
type	O
(	O
in	O
C++	B-Language
,	O
)	O
.	O
</s>
<s>
Nevertheless	O
,	O
in	O
situations	O
limited	O
to	O
a	O
specific	O
platform	O
and	O
the	O
compiler	B-Language
implementation	O
,	O
multicharacter	O
constants	O
do	O
find	O
their	O
use	O
in	O
specifying	O
signatures	O
.	O
</s>
<s>
One	O
common	O
use	O
case	O
is	O
the	O
OSType	B-Application
,	O
where	O
the	O
combination	O
of	O
Classic	O
Mac	O
OS	O
compilers	B-Language
and	O
its	O
inherent	O
big-endianness	O
means	O
that	O
bytes	B-Application
in	O
the	O
integer	O
appear	O
in	O
the	O
exact	O
order	O
of	O
characters	O
defined	O
in	O
the	O
literal	O
.	O
</s>
<s>
The	O
definition	O
by	O
popular	O
"	O
implementations	O
"	O
are	O
in	O
fact	O
consistent	O
:	O
in	O
GCC	B-Application
,	O
Clang	B-Application
,	O
and	O
Visual	B-Application
C++	I-Application
,	O
yields	O
0x31323334	O
under	O
ASCII	O
.	O
</s>
<s>
Since	O
type	O
is	O
1	O
byte	B-Application
wide	O
,	O
a	O
single	O
value	O
typically	O
can	O
represent	O
at	O
most	O
255	O
distinct	O
character	B-General_Concept
codes	I-General_Concept
,	O
not	O
nearly	O
enough	O
for	O
all	O
the	O
characters	O
in	O
use	O
worldwide	O
.	O
</s>
<s>
Wide	B-Language
characters	I-Language
are	O
most	O
commonly	O
either	O
2	O
bytes	B-Application
(	O
using	O
a	O
2-byte	O
encoding	O
such	O
as	O
UTF-16	O
)	O
or	O
4	O
bytes	B-Application
(	O
usually	O
UTF-32	O
)	O
,	O
but	O
Standard	O
C	B-Language
does	O
not	O
specify	O
the	O
width	O
for	O
,	O
leaving	O
the	O
choice	O
to	O
the	O
implementor	O
.	O
</s>
<s>
Microsoft	B-Application
Windows	I-Application
generally	O
uses	O
UTF-16	O
,	O
thus	O
the	O
above	O
string	O
would	O
be	O
26	O
bytes	B-Application
long	O
for	O
a	O
Microsoft	O
compiler	B-Language
;	O
the	O
Unix	B-Application
world	O
prefers	O
UTF-32	O
,	O
thus	O
compilers	B-Language
such	O
as	O
GCC	B-Application
would	O
generate	O
a	O
52-byte	O
string	O
.	O
</s>
<s>
A	O
2-byte	O
wide	O
suffers	O
the	O
same	O
limitation	O
as	O
,	O
in	O
that	O
certain	O
characters	O
(	O
those	O
outside	O
the	O
BMP	O
)	O
cannot	O
be	O
represented	O
in	O
a	O
single	O
;	O
but	O
must	O
be	O
represented	O
using	O
surrogate	O
pairs	O
.	O
</s>
<s>
The	O
original	O
C	B-Language
standard	O
specified	O
only	O
minimal	O
functions	O
for	O
operating	O
with	O
wide	B-Language
character	I-Language
strings	O
;	O
in	O
1995	O
the	O
standard	O
was	O
modified	O
to	O
include	O
much	O
more	O
extensive	O
support	O
,	O
comparable	O
to	O
that	O
for	O
strings	O
.	O
</s>
<s>
The	O
now	O
generally	O
recommended	O
methodsee	O
UTF-8	O
first	O
section	O
for	O
references	O
of	O
supporting	O
international	O
characters	O
is	O
through	O
UTF-8	O
,	O
which	O
is	O
stored	O
in	O
arrays	O
,	O
and	O
can	O
be	O
written	O
directly	O
in	O
the	O
source	O
code	O
if	O
using	O
a	O
UTF-8	O
editor	O
,	O
because	O
UTF-8	O
is	O
a	O
direct	O
ASCII	B-Protocol
extension	I-Protocol
.	O
</s>
<s>
Variable-width	O
strings	O
may	O
be	O
encoded	O
into	O
literals	O
verbatim	O
,	O
at	O
the	O
risk	O
of	O
confusing	O
the	O
compiler	B-Language
,	O
or	O
using	O
numerical	O
backslash	O
escapes	O
(	O
e.g.	O
</s>
<s>
The	O
UTF-8	O
encoding	O
was	O
specifically	O
designed	O
(	O
under	O
Plan	B-Operating_System
9	I-Operating_System
)	O
for	O
compatibility	O
with	O
the	O
standard	B-Language
library	I-Language
string	O
functions	O
;	O
supporting	O
features	O
of	O
the	O
encoding	O
include	O
a	O
lack	O
of	O
embedded	O
nulls	O
,	O
no	O
valid	O
interpretations	O
for	O
subsequences	O
,	O
and	O
trivial	O
resynchronisation	O
.	O
</s>
<s>
Encodings	O
lacking	O
these	O
features	O
are	O
likely	O
to	O
prove	O
incompatible	O
with	O
the	O
standard	B-Language
library	I-Language
functions	O
;	O
encoding-aware	O
string	O
functions	O
are	O
often	O
used	O
in	O
such	O
cases	O
.	O
</s>
<s>
Strings	O
,	O
both	O
constant	O
and	O
variable	O
,	O
can	O
be	O
manipulated	O
without	O
using	O
the	O
standard	B-Language
library	I-Language
.	O
</s>
<s>
However	O
,	O
the	O
library	O
contains	O
many	O
useful	B-Language
functions	I-Language
for	O
working	O
with	O
null-terminated	O
strings	O
.	O
</s>
<s>
Structures	O
and	O
unions	O
in	O
C	B-Language
are	O
defined	O
as	O
data	O
containers	O
consisting	O
of	O
a	O
sequence	O
of	O
named	O
members	O
of	O
various	O
types	O
.	O
</s>
<s>
The	O
members	O
of	O
a	O
structure	O
are	O
stored	O
in	O
consecutive	O
locations	O
in	O
memory	O
,	O
although	O
the	O
compiler	B-Language
is	O
allowed	O
to	O
insert	O
padding	B-Application
between	O
or	O
after	O
members	O
(	O
but	O
not	O
before	O
the	O
first	O
member	O
)	O
for	O
efficiency	O
or	O
as	O
padding	B-Application
required	O
for	O
proper	O
alignment	B-Application
by	O
the	O
target	O
architecture	O
.	O
</s>
<s>
The	O
size	O
of	O
a	O
structure	O
is	O
equal	O
to	O
the	O
sum	O
of	O
the	O
sizes	O
of	O
its	O
members	O
,	O
plus	O
the	O
size	O
of	O
the	O
padding	B-Application
.	O
</s>
<s>
Unions	O
in	O
C	B-Language
are	O
related	O
to	O
structures	O
and	O
are	O
defined	O
as	O
objects	O
that	O
may	O
hold	O
(	O
at	O
different	O
times	O
)	O
objects	O
of	O
different	O
types	O
and	O
sizes	O
.	O
</s>
<s>
float	B-Algorithm
y	O
;	O
</s>
<s>
float	B-Algorithm
y	O
;	O
</s>
<s>
struct	B-Language
s	O
r	O
;	O
</s>
<s>
It	O
is	O
also	O
common	O
to	O
use	O
the	O
typedef	B-Language
specifier	O
to	O
eliminate	O
the	O
need	O
for	O
the	O
or	O
keyword	O
in	O
later	O
references	O
to	O
the	O
structure	O
.	O
</s>
<s>
typedef	B-Language
struct	B-Language
 { ... } 	O
s_type	O
;	O
</s>
<s>
struct	B-Language
s	O
*	O
ptr_to_tee	O
=	O
&	O
tee	O
;	O
</s>
<s>
Because	O
this	O
operation	O
is	O
common	O
,	O
C	B-Language
provides	O
an	O
abbreviated	O
syntax	O
for	O
accessing	O
a	O
member	O
directly	O
from	O
a	O
pointer	O
.	O
</s>
<s>
This	O
can	O
be	O
chained	O
;	O
for	O
example	O
,	O
in	O
a	O
linked	B-Application
list	O
,	O
one	O
may	O
refer	O
to	O
n->next->next	O
for	O
the	O
second	O
following	O
node	O
(	O
assuming	O
that	O
n->next	O
is	O
not	O
null	O
)	O
.	O
</s>
<s>
According	O
to	O
the	O
C	B-Language
standard	O
,	O
the	O
only	O
legal	O
operations	O
that	O
can	O
be	O
performed	O
on	O
a	O
structure	O
are	O
copying	O
it	O
,	O
assigning	O
to	O
it	O
as	O
a	O
unit	O
(	O
or	O
initializing	O
it	O
)	O
,	O
taking	O
its	O
address	O
with	O
the	O
address-of	O
(	O
)	O
unary	O
operator	O
,	O
and	O
accessing	O
its	O
members	O
.	O
</s>
<s>
One	O
of	O
the	O
operations	O
implicitly	O
forbidden	O
is	O
comparison	O
:	O
structures	O
and	O
unions	O
cannot	O
be	O
compared	O
using	O
C	B-Language
's	O
standard	O
comparison	O
facilities	O
(	O
,	O
,	O
,	O
etc	O
.	O
</s>
<s>
C	B-Language
also	O
provides	O
a	O
special	O
type	O
of	O
structure	O
member	O
known	O
as	O
a	O
bit	O
field	O
,	O
which	O
is	O
an	O
integer	O
with	O
an	O
explicitly	O
specified	O
number	O
of	O
bits	O
.	O
</s>
<s>
As	O
a	O
special	O
exception	O
to	O
the	O
usual	O
C	B-Language
syntax	O
rules	O
,	O
it	O
is	O
implementation-defined	O
whether	O
a	O
bit	O
field	O
declared	O
as	O
type	O
,	O
without	O
specifying	O
or	O
,	O
is	O
signed	O
or	O
unsigned	B-Algorithm
.	O
</s>
<s>
Unnamed	O
fields	O
consisting	O
of	O
just	O
a	O
colon	O
followed	O
by	O
a	O
number	O
of	O
bits	O
are	O
also	O
allowed	O
;	O
these	O
indicate	O
padding	B-Application
.	O
</s>
<s>
Default	O
initialization	O
depends	O
on	O
the	O
storage	B-Language
class	I-Language
specifier	I-Language
,	O
described	O
above	O
.	O
</s>
<s>
Most	O
compilers	B-Language
issue	O
a	O
warning	O
if	O
there	O
is	O
more	O
than	O
one	O
such	O
pair	O
,	O
though	O
.	O
</s>
<s>
float	B-Algorithm
y	O
;	O
</s>
<s>
struct	B-Language
s	O
pi	O
=	O
{	O
3	O
,	O
3.1415	O
,	O
"	O
Pi	O
"	O
}	O
;	O
</s>
<s>
struct	B-Language
s	O
pi	O
=	O
{	O
.z	O
=	O
"	O
Pi	O
"	O
,	O
.x	O
=	O
3	O
,	O
.y	O
=	O
3.1415	O
}	O
;	O
</s>
<s>
In	O
the	O
example	O
below	O
,	O
if	O
MAX	O
is	O
greater	O
than	O
10	O
,	O
there	O
will	O
be	O
some	O
zero-valued	O
elements	O
in	O
the	O
middle	O
of	O
a	O
;	O
if	O
it	O
is	O
less	O
than	O
10	O
,	O
some	O
of	O
the	O
values	O
provided	O
by	O
the	O
first	O
five	O
initializers	O
will	O
be	O
overridden	O
by	O
the	O
second	O
five	O
(	O
if	O
MAX	O
is	O
less	O
than	O
5	O
,	O
there	O
will	O
be	O
a	O
compilation	B-Language
error	O
)	O
:	O
</s>
<s>
struct	B-Language
{	O
int	O
a[3],	O
b	O
;	O
}	O
w[]	O
=	O
{	O
[0].a	O
=	O
{1},	O
 [ 1 ] .a [ 0 ] 	O
=	O
2	O
}	O
;	O
</s>
<s>
There	O
is	O
no	O
way	O
to	O
specify	O
repetition	O
of	O
an	O
initializer	O
in	O
standard	O
C	B-Language
.	O
</s>
<s>
float	B-Algorithm
( *	O
foo	O
)	O
 [ 3 ] 	O
=	O
&( 	O
float[]	O
)	O
{	O
0.5f	O
,	O
1.f	O
,	O
-0.5f	O
}	O
;	O
</s>
<s>
struct	B-Language
s	O
pi	O
=	O
(	O
struct	B-Language
s	O
)	O
{	O
3	O
,	O
3.1415	O
,	O
"	O
Pi	O
"	O
}	O
;	O
</s>
<s>
pi	O
=	O
(	O
struct	B-Language
s	O
)	O
{	O
.z	O
=	O
"	O
Pi	O
"	O
,	O
.x	O
=	O
3	O
,	O
.y	O
=	O
3.1415	O
}	O
;	O
</s>
<s>
C	B-Language
is	O
a	O
free-form	B-Language
language	I-Language
.	O
</s>
<s>
Bracing	O
style	O
varies	O
from	O
programmer	B-General_Concept
to	O
programmer	B-General_Concept
and	O
can	O
be	O
the	O
subject	O
of	O
debate	O
.	O
</s>
<s>
The	O
declaration-list	O
declares	O
variables	O
to	O
be	O
used	O
in	O
that	O
scope	B-Language
,	O
and	O
the	O
statement-list	O
are	O
the	O
actions	O
to	O
be	O
performed	O
.	O
</s>
<s>
Declarations	O
and	O
statements	O
can	O
be	O
freely	O
intermixed	O
within	O
a	O
compound	O
statement	O
(	O
as	O
in	O
C++	B-Language
)	O
.	O
</s>
<s>
C	B-Language
has	O
two	O
types	O
of	O
selection	B-Language
statements	I-Language
:	O
the	O
statement	O
and	O
the	O
statement	O
.	O
</s>
<s>
Examples	O
of	O
this	O
include	O
Duff	O
's	O
device	O
and	O
Simon	O
Tatham	O
's	O
implementation	O
of	O
coroutines	B-Architecture
in	O
Putty	B-Operating_System
.	O
</s>
<s>
C	B-Language
has	O
three	O
forms	O
of	O
iteration	B-Algorithm
statement	O
:	O
</s>
<s>
With	O
,	O
the	O
test	O
,	O
including	O
all	O
side	O
effects	O
from	O
,	O
occurs	O
before	O
each	O
iteration	B-Algorithm
(	O
execution	O
of	O
)	O
;	O
with	O
,	O
the	O
test	O
occurs	O
after	O
each	O
iteration	B-Algorithm
.	O
</s>
<s>
Since	O
C99	B-Language
,	O
the	O
first	O
expression	O
may	O
take	O
the	O
form	O
of	O
a	O
declaration	O
,	O
typically	O
including	O
an	O
initializer	O
,	O
such	O
as	O
:	O
</s>
<s>
The	O
declaration	O
's	O
scope	B-Language
is	O
limited	O
to	O
the	O
extent	O
of	O
the	O
loop	O
.	O
</s>
<s>
Jump	B-General_Concept
statements	I-General_Concept
transfer	O
control	O
unconditionally	O
.	O
</s>
<s>
There	O
are	O
four	O
types	O
of	O
jump	B-General_Concept
statements	I-General_Concept
in	O
C	B-Language
:	O
,	O
,	O
,	O
and	O
.	O
</s>
<s>
goto	B-Application
<identifier>	O
;	O
</s>
<s>
A	O
statement	O
may	O
appear	O
only	O
within	O
an	O
iteration	B-Algorithm
statement	O
and	O
causes	O
control	O
to	O
pass	O
to	O
the	O
loop-continuation	O
portion	O
of	O
the	O
innermost	O
enclosing	O
iteration	B-Algorithm
statement	O
.	O
</s>
<s>
a	O
not	O
contained	O
within	O
a	O
nested	O
iteration	B-Algorithm
statement	O
is	O
the	O
same	O
as	O
.	O
</s>
<s>
GCC	B-Application
extends	O
the	O
C	B-Language
language	I-Language
with	O
a	O
unary	O
operator	O
that	O
returns	O
the	O
address	O
of	O
a	O
label	O
.	O
</s>
<s>
J1	O
:	O
printf("hi " )	O
;	O
</s>
<s>
goto	B-Application
*	O
ptr	O
;	O
</s>
<s>
A	O
C	B-Language
function	O
definition	O
consists	O
of	O
a	O
return	O
type	O
(	O
if	O
no	O
value	O
is	O
returned	O
)	O
,	O
a	O
unique	O
name	O
,	O
a	O
list	O
of	O
parameters	O
in	O
parentheses	O
,	O
and	O
various	O
statements	O
:	O
</s>
<s>
A	O
commonly	O
used	O
function	O
that	O
does	O
this	O
is	O
the	O
standard	B-Language
library	I-Language
function	O
,	O
which	O
has	O
the	O
declaration	O
:	O
</s>
<s>
int	O
printf	B-Language
(	O
const	O
char*	O
,	O
...	O
)	O
;	O
</s>
<s>
Manipulation	O
of	O
these	O
parameters	O
can	O
be	O
done	O
by	O
using	O
the	O
routines	O
in	O
the	O
standard	B-Language
library	I-Language
header	O
.	O
</s>
<s>
The	O
following	O
program	B-Application
shows	O
use	O
of	O
a	O
function	B-Language
pointer	I-Language
for	O
selecting	O
between	O
addition	O
and	O
subtraction	O
:	O
</s>
<s>
printf( 	O
"	O
%d	B-Language
+	O
%d	B-Language
=	O
%d	B-Language
\n	O
 "	O
,	O
foo	O
,	O
bar	O
,	O
operation(foo, bar )	O
)	O
;	O
</s>
<s>
printf( 	O
"	O
%d	B-Language
-	O
%d	B-Language
=	O
%d	B-Language
\n	O
 "	O
,	O
foo	O
,	O
bar	O
,	O
operation(foo, bar )	O
)	O
;	O
</s>
<s>
After	O
preprocessing	O
,	O
at	O
the	O
highest	O
level	O
a	O
C	B-Language
program	I-Language
consists	O
of	O
a	O
sequence	O
of	O
declarations	O
at	O
file	O
scope	B-Language
.	O
</s>
<s>
These	O
may	O
be	O
partitioned	O
into	O
several	O
separate	O
source	O
files	O
,	O
which	O
may	O
be	O
compiled	B-Language
separately	O
;	O
the	O
resulting	O
object	O
modules	O
are	O
then	O
linked	B-Application
along	O
with	O
implementation-provided	O
run-time	O
support	O
modules	O
to	O
produce	O
an	O
executable	O
image	O
.	O
</s>
<s>
C	B-Language
functions	I-Language
are	O
akin	O
to	O
the	O
subroutines	O
of	O
Fortran	B-Application
or	O
the	O
procedures	O
of	O
Pascal	B-Application
.	O
</s>
<s>
An	O
implementation	O
of	O
C	B-Language
providing	O
all	O
of	O
the	O
standard	B-Language
library	I-Language
functions	O
is	O
called	O
a	O
hosted	O
implementation	O
.	O
</s>
<s>
Programs	O
written	O
for	O
hosted	O
implementations	O
are	O
required	O
to	O
define	O
a	O
special	O
function	O
called	O
,	O
which	O
is	O
the	O
first	O
function	O
called	O
when	O
a	O
program	B-Application
begins	O
executing	O
.	O
</s>
<s>
Hosted	O
implementations	O
start	O
program	B-Application
execution	O
by	O
invoking	O
the	O
function	O
,	O
which	O
must	O
be	O
defined	O
following	O
one	O
of	O
these	O
prototypes	O
:	O
</s>
<s>
The	O
first	O
two	O
definitions	O
are	O
equivalent	O
(	O
and	O
both	O
are	O
compatible	O
with	O
C++	B-Language
)	O
.	O
</s>
<s>
It	O
is	O
probably	O
up	O
to	O
individual	O
preference	O
which	O
one	O
is	O
used	O
(	O
the	O
current	O
C	B-Language
standard	O
contains	O
two	O
examples	O
of	O
and	O
two	O
of	O
,	O
but	O
the	O
draft	O
C++	B-Language
standard	O
uses	O
)	O
.	O
</s>
<s>
The	O
return	B-Language
value	I-Language
of	O
(	O
which	O
should	O
be	O
)	O
serves	O
as	O
termination	O
status	O
returned	O
to	O
the	O
host	O
environment	O
.	O
</s>
<s>
The	O
C	B-Language
standard	O
defines	O
return	B-Language
values	I-Language
and	O
as	O
indicating	O
success	O
and	O
as	O
indicating	O
failure	O
.	O
</s>
<s>
Other	O
return	B-Language
values	I-Language
have	O
implementation-defined	O
meanings	O
;	O
for	O
example	O
,	O
under	O
Linux	B-Application
a	O
program	B-Application
killed	O
by	O
a	O
signal	B-Operating_System
yields	O
a	O
return	O
code	O
of	O
the	O
numerical	O
value	O
of	O
the	O
signal	B-Operating_System
plus	O
128	O
.	O
</s>
<s>
A	O
minimal	O
correct	O
C	B-Language
program	I-Language
consists	O
of	O
an	O
empty	O
routine	O
,	O
taking	O
no	O
arguments	O
and	O
doing	O
nothing	O
:	O
</s>
<s>
Because	O
no	O
return	B-Language
statement	I-Language
is	O
present	O
,	O
main	O
returns	O
0	O
on	O
exit	O
.	O
</s>
<s>
(	O
This	O
is	O
a	O
special-case	O
feature	O
introduced	O
in	O
C99	B-Language
that	O
applies	O
only	O
to	O
main	O
.	O
)	O
</s>
<s>
Some	O
implementations	O
are	O
not	O
hosted	O
,	O
usually	O
because	O
they	O
are	O
not	O
intended	O
to	O
be	O
used	O
with	O
an	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
Such	O
implementations	O
are	O
called	O
free-standing	O
in	O
the	O
C	B-Language
standard	O
.	O
</s>
<s>
A	O
free-standing	O
implementation	O
is	O
free	O
to	O
specify	O
how	O
it	O
handles	O
program	B-Application
startup	O
;	O
in	O
particular	O
it	O
need	O
not	O
require	O
a	O
program	B-Application
to	O
define	O
a	O
function	O
.	O
</s>
<s>
Functions	O
may	O
be	O
written	O
by	O
the	O
programmer	B-General_Concept
or	O
provided	O
by	O
existing	O
libraries	O
.	O
</s>
<s>
Interfaces	O
for	O
the	O
latter	O
are	O
usually	O
declared	O
by	O
including	O
header	B-Language
files	I-Language
—	O
with	O
the	O
preprocessing	B-Application
directive	I-Application
—	O
and	O
the	O
library	O
objects	O
are	O
linked	B-Application
into	O
the	O
final	O
executable	O
image	O
.	O
</s>
<s>
Certain	O
library	O
functions	O
,	O
such	O
as	O
,	O
are	O
defined	O
by	O
the	O
C	B-Language
standard	O
;	O
these	O
are	O
referred	O
to	O
as	O
the	O
standard	B-Language
library	I-Language
functions	O
.	O
</s>
<s>
A	O
function	O
may	O
return	O
a	O
value	O
to	O
caller	O
(	O
usually	O
another	O
C	B-Language
function	O
,	O
or	O
the	O
hosting	O
environment	O
for	O
the	O
function	O
)	O
.	O
</s>
<s>
In	O
C	B-Language
,	O
arguments	O
are	O
passed	O
to	O
functions	O
by	O
value	O
while	O
other	O
languages	O
may	O
pass	O
variables	O
by	O
reference	O
.	O
</s>
<s>
The	O
function	O
scanf	B-Language
works	O
the	O
same	O
way	O
:	O
</s>
<s>
scanf( 	O
"	O
%d	B-Language
"	O
,	O
&	O
x	O
)	O
;	O
</s>
<s>
*	O
a_p	O
=	O
malloc(sizeof(int )	O
*	O
A	O
)	O
;	O
</s>
<s>
The	O
parameter	O
is	O
a	O
pointer	O
to	O
a	O
pointer	O
to	O
an	O
,	O
which	O
is	O
the	O
address	O
of	O
the	O
pointer	O
defined	O
in	O
the	O
main	B-Language
function	I-Language
in	O
this	O
case	O
.	O
</s>
<s>
Function	O
parameters	O
of	O
array	O
type	O
may	O
at	O
first	O
glance	O
appear	O
to	O
be	O
an	O
exception	O
to	O
C	B-Language
's	O
pass-by-value	O
rule	O
.	O
</s>
<s>
The	O
following	O
program	B-Application
will	O
print	O
2	O
,	O
not	O
1	O
:	O
</s>
<s>
printf	B-Language
(	O
"	O
a[0]	O
=%d	O
\n	O
 "	O
,	O
a[0]	O
)	O
;	O
</s>
<s>
At	O
the	O
same	O
time	O
,	O
C	B-Language
rules	O
for	O
the	O
use	O
of	O
arrays	O
in	O
expressions	O
cause	O
the	O
value	O
of	O
in	O
the	O
call	O
to	O
to	O
be	O
converted	O
to	O
a	O
pointer	O
to	O
the	O
first	O
element	O
of	O
array	O
.	O
</s>
<s>
C	B-Language
identifiers	O
are	O
case	O
sensitive	O
(	O
e.g.	O
,	O
,	O
,	O
and	O
are	O
the	O
names	O
of	O
different	O
objects	O
)	O
.	O
</s>
<s>
Some	O
linkers	B-Application
may	O
map	O
external	O
identifiers	O
to	O
a	O
single	O
case	O
,	O
although	O
this	O
is	O
uncommon	O
in	O
most	O
modern	O
linkers	B-Application
.	O
</s>
<s>
C-style	O
comments	O
do	O
not	O
nest	O
;	O
that	O
is	O
,	O
accidentally	O
placing	O
a	O
comment	O
within	O
a	O
comment	O
has	O
unintended	O
results	O
:	O
</s>
<s>
A	O
compiler	B-Language
warning	O
may	O
be	O
produced	O
here	O
.	O
</s>
<s>
Both	O
will	O
likely	O
produce	O
compile	B-Language
errors	O
.	O
</s>
<s>
C++	B-Language
style	O
line	O
comments	O
start	O
with	O
and	O
extend	O
to	O
the	O
end	O
of	O
the	O
line	O
.	O
</s>
<s>
This	O
style	O
of	O
comment	O
originated	O
in	O
BCPL	B-Language
and	O
became	O
valid	O
C	B-Language
syntax	O
in	O
C99	B-Language
;	O
it	O
is	O
not	O
available	O
in	O
the	O
original	O
K&R	O
C	B-Language
nor	O
in	O
ANSI	O
C	B-Language
:	O
</s>
<s>
The	O
parameters	O
given	O
on	O
a	O
command	B-Application
line	I-Application
are	O
passed	O
to	O
a	O
C	B-Language
program	I-Language
with	O
two	O
predefined	O
variables	O
-	O
the	O
count	O
of	O
the	O
command-line	B-Application
arguments	O
in	O
and	O
the	O
individual	O
arguments	O
as	O
character	O
strings	O
in	O
the	O
pointer	O
array	O
.	O
</s>
<s>
The	O
name	O
of	O
the	O
program	B-Application
,	O
,	O
may	O
be	O
useful	O
when	O
printing	O
diagnostic	O
messages	O
or	O
for	O
making	O
one	O
binary	O
serve	O
multiple	O
purposes	O
.	O
</s>
<s>
The	O
individual	O
values	O
of	O
the	O
parameters	O
may	O
be	O
accessed	O
with	O
,	O
,	O
and	O
,	O
as	O
shown	O
in	O
the	O
following	O
program	B-Application
:	O
</s>
<s>
printf( 	O
"	O
argc	O
\t=	O
%d	B-Language
\n	O
 "	O
,	O
argc	O
)	O
;	O
</s>
<s>
printf( 	O
"	O
argv[%i]	O
\t=	O
%s	B-Language
\n	O
 "	O
,	O
i	O
,	O
argv[i]	O
)	O
;	O
</s>
<s>
Formally	O
,	O
a	O
conforming	O
C	B-Language
compiler	B-Language
may	O
evaluate	O
expressions	O
in	O
any	O
order	O
between	O
sequence	B-Application
points	I-Application
(	O
this	O
allows	O
the	O
compiler	B-Language
to	O
do	O
some	O
optimization	O
)	O
.	O
</s>
<s>
Sequence	B-Application
points	I-Application
are	O
defined	O
by	O
:	O
</s>
<s>
However	O
,	O
commas	O
that	O
delimit	O
function	O
arguments	O
are	O
not	O
sequence	B-Application
points	I-Application
.	O
</s>
<s>
Expressions	O
before	O
a	O
sequence	B-Application
point	I-Application
are	O
always	O
evaluated	O
before	O
those	O
after	O
a	O
sequence	B-Application
point	I-Application
.	O
</s>
<s>
printf( 	O
"	O
%s	B-Language
%s	B-Language
\n	O
 "	O
,	O
argv[ i	O
=	O
0 ]	O
,	O
argv[++i]	O
)	O
;	O
</s>
<s>
An	O
aspect	O
of	O
the	O
C	B-Language
standard	O
(	O
not	O
unique	O
to	O
C	B-Language
)	O
is	O
that	O
the	O
behavior	O
of	O
certain	O
code	O
is	O
said	O
to	O
be	O
"	O
undefined	O
"	O
.	O
</s>
<s>
In	O
practice	O
,	O
this	O
means	O
that	O
the	O
program	B-Application
produced	O
from	O
this	O
code	O
can	O
do	O
anything	O
,	O
from	O
working	O
as	O
the	O
programmer	B-General_Concept
intended	O
,	O
to	O
crashing	O
every	O
time	O
it	O
is	O
run	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
code	O
produces	O
undefined	O
behavior	O
,	O
because	O
the	O
variable	O
b	O
is	O
modified	O
more	O
than	O
once	O
with	O
no	O
intervening	O
sequence	B-Application
point	I-Application
:	O
</s>
<s>
printf( 	O
"	O
%d	B-Language
\n	O
 "	O
,	O
a	O
)	O
;	O
</s>
<s>
Because	O
there	O
is	O
no	O
sequence	B-Application
point	I-Application
between	O
the	O
modifications	O
of	O
b	O
in	O
"	O
b++	O
+	O
b''++	O
"	O
,	O
it	O
is	O
possible	O
to	O
perform	O
the	O
evaluation	O
steps	O
in	O
more	O
than	O
one	O
order	O
,	O
resulting	O
in	O
an	O
ambiguous	O
statement	O
.	O
</s>
<s>
This	O
can	O
be	O
fixed	O
by	O
rewriting	O
the	O
code	O
to	O
insert	O
a	O
sequence	B-Application
point	I-Application
in	O
order	O
to	O
enforce	O
an	O
unambiguous	O
behavior	O
,	O
for	O
example	O
:	O
</s>
