<s>
C	B-Language
(	O
pronounced	O
–	O
like	O
the	O
letter	O
c	B-Language
)	O
is	O
a	O
general-purpose	B-General_Concept
computer	O
programming	O
language	O
.	O
</s>
<s>
By	O
design	O
,	O
C	B-Language
's	O
features	O
cleanly	O
reflect	O
the	O
capabilities	O
of	O
the	O
targeted	O
CPUs	O
.	O
</s>
<s>
It	O
has	O
found	O
lasting	O
use	O
in	O
operating	B-General_Concept
systems	I-General_Concept
,	O
device	B-Application
drivers	I-Application
,	O
protocol	B-Protocol
stacks	I-Protocol
,	O
though	O
decreasingly	O
for	B-Language
application	B-Application
software	I-Application
.	O
</s>
<s>
C	B-Language
is	O
commonly	O
used	O
on	O
computer	B-General_Concept
architectures	I-General_Concept
that	O
range	O
from	O
the	O
largest	O
supercomputers	B-Architecture
to	O
the	O
smallest	O
microcontrollers	B-Architecture
and	O
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
A	O
successor	O
to	O
the	O
programming	O
language	O
B	B-Language
,	O
C	B-Language
was	O
originally	O
developed	O
at	O
Bell	O
Labs	O
by	O
Ritchie	O
between	O
1972	O
and	O
1973	O
to	O
construct	O
utilities	O
running	O
on	O
Unix	B-Application
.	O
</s>
<s>
It	O
was	O
applied	O
to	O
re-implementing	O
the	O
kernel	B-Operating_System
of	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
.	O
</s>
<s>
During	O
the	O
1980s	O
,	O
C	B-Language
gradually	O
gained	O
popularity	O
.	O
</s>
<s>
It	O
has	O
become	O
one	O
of	O
the	O
most	O
widely	O
used	O
programming	O
languages	O
,	O
with	O
C	B-Language
compilers	B-Language
available	O
for	B-Language
practically	O
all	O
modern	O
computer	B-General_Concept
architectures	I-General_Concept
and	O
operating	B-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
C	B-Language
has	O
been	O
standardized	O
by	O
ANSI	O
since	O
1989	O
(	O
ANSI	O
C	B-Language
)	O
and	O
by	O
the	O
International	O
Organization	O
for	B-Language
Standardization	O
(	O
ISO	O
)	O
.	O
</s>
<s>
C	B-Language
is	O
an	O
imperative	B-Application
procedural	B-Application
language	I-Application
,	O
supporting	O
structured	B-Language
programming	I-Language
,	O
lexical	O
variable	O
scope	O
and	O
recursion	O
,	O
with	O
a	O
static	B-Language
type	O
system	O
.	O
</s>
<s>
It	O
was	O
designed	O
to	O
be	O
compiled	B-Language
to	O
provide	O
low-level	B-Language
access	O
to	O
memory	B-General_Concept
and	O
language	O
constructs	O
that	O
map	O
efficiently	O
to	O
machine	B-Language
instructions	I-Language
,	O
all	O
with	O
minimal	O
runtime	B-Device
support	I-Device
.	O
</s>
<s>
Despite	O
its	O
low-level	B-Language
capabilities	O
,	O
the	O
language	O
was	O
designed	O
to	O
encourage	O
cross-platform	B-Operating_System
programming	O
.	O
</s>
<s>
A	O
standards-compliant	O
C	B-Language
program	I-Language
written	O
with	O
portability	B-Architecture
in	O
mind	O
can	O
be	O
compiled	B-Language
for	B-Language
a	O
wide	O
variety	O
of	O
computer	B-Device
platforms	I-Device
and	O
operating	B-General_Concept
systems	I-General_Concept
with	O
few	O
changes	O
to	O
its	O
source	O
code	O
.	O
</s>
<s>
Since	O
2000	O
,	O
C	B-Language
has	O
consistently	O
ranked	O
among	O
the	O
top	O
two	O
languages	O
in	O
the	O
TIOBE	O
index	O
,	O
a	O
measure	O
of	O
the	O
popularity	O
of	O
programming	O
languages	O
.	O
</s>
<s>
C	B-Language
is	O
an	O
imperative	B-Application
,	O
procedural	B-Application
language	I-Application
in	O
the	O
ALGOL	B-Language
tradition	O
.	O
</s>
<s>
It	O
has	O
a	O
static	B-Language
type	O
system	O
.	O
</s>
<s>
In	O
C	B-Language
,	O
all	O
executable	B-Application
code	I-Application
is	O
contained	O
within	O
subroutines	O
(	O
also	O
called	O
"	O
functions	O
"	O
,	O
though	O
not	O
in	O
the	O
sense	O
of	O
functional	B-Language
programming	I-Language
)	O
.	O
</s>
<s>
Pass-by-reference	O
is	O
simulated	O
in	O
C	B-Language
by	O
explicitly	O
passing	O
pointers	O
to	O
the	O
thing	O
being	O
referenced	O
.	O
</s>
<s>
C	B-Language
program	I-Language
source	O
text	O
is	O
free-form	B-Language
code	O
.	O
</s>
<s>
The	O
semicolon	O
separates	O
statements	O
and	O
curly	O
braces	O
are	O
used	O
for	B-Language
grouping	O
blocks	O
of	O
statements	O
.	O
</s>
<s>
The	O
C	B-Language
language	I-Language
also	O
exhibits	O
the	O
following	O
characteristics	O
:	O
</s>
<s>
The	O
language	O
has	O
a	O
small	O
,	O
fixed	O
number	O
of	O
keywords	O
,	O
including	O
a	O
full	O
set	O
of	O
control	O
flow	O
primitives	O
:	O
if/else	B-Language
,	O
for	B-Language
,	O
do/while	O
,	O
while	O
,	O
and	O
switch	O
.	O
</s>
<s>
Function	O
and	O
data	O
pointers	O
permit	O
ad	O
hoc	O
run-time	B-Library
polymorphism	O
.	O
</s>
<s>
Data	O
typing	O
is	O
static	B-Language
,	O
but	O
weakly	O
enforced	O
;	O
all	O
data	O
has	O
a	O
type	O
,	O
but	O
implicit	O
conversions	O
are	O
possible	O
.	O
</s>
<s>
User-defined	O
(	O
typedef	B-Language
)	O
and	O
compound	O
types	O
are	O
possible	O
.	O
</s>
<s>
Heterogeneous	O
aggregate	O
data	O
types	O
(	O
struct	B-Language
)	O
allow	O
related	O
data	O
elements	O
to	O
be	O
accessed	O
and	O
assigned	O
as	O
a	O
unit	O
.	O
</s>
<s>
Unlike	O
structs	B-Language
,	O
arrays	O
are	O
not	O
first-class	O
objects	O
:	O
they	O
cannot	O
be	O
assigned	O
or	O
compared	O
using	O
single	O
built-in	O
operators	O
.	O
</s>
<s>
There	O
is	O
no	O
"	O
array	O
"	O
keyword	O
in	O
use	O
or	O
definition	O
;	O
instead	O
,	O
square	O
brackets	O
indicate	O
arrays	O
syntactically	O
,	O
for	B-Language
example	O
month[11]	O
.	O
</s>
<s>
Enumerated	B-Language
types	I-Language
are	O
possible	O
with	O
the	O
enum	B-Language
keyword	O
.	O
</s>
<s>
Strings	O
are	O
not	O
a	O
distinct	O
data	O
type	O
,	O
but	O
are	O
conventionally	O
implemented	B-Language
as	O
null-terminated	B-Data_Structure
character	O
arrays	O
.	O
</s>
<s>
Low-level	B-Language
access	O
to	O
computer	B-General_Concept
memory	I-General_Concept
is	O
possible	O
by	O
converting	O
machine	O
addresses	O
to	O
pointers	O
.	O
</s>
<s>
Memory	B-General_Concept
can	O
be	O
allocated	B-Application
to	O
a	O
program	O
with	O
calls	O
to	O
library	B-Library
routines	I-Library
.	O
</s>
<s>
A	O
preprocessor	B-General_Concept
performs	O
macro	O
definition	O
,	O
source	O
code	O
file	O
inclusion	O
,	O
and	O
conditional	B-Application
compilation	I-Application
.	O
</s>
<s>
There	O
is	O
a	O
basic	O
form	O
of	O
modularity	B-Architecture
:	O
files	O
can	O
be	O
compiled	B-Language
separately	O
and	O
linked	B-Application
together	O
,	O
with	O
control	O
over	O
which	O
functions	O
and	O
data	O
objects	O
are	O
visible	O
to	O
other	O
files	O
via	O
static	B-Language
and	O
extern	O
attributes	O
.	O
</s>
<s>
Complex	O
functionality	O
such	O
as	O
I/O	B-General_Concept
,	O
string	B-Language
manipulation	O
,	O
and	O
mathematical	O
functions	O
are	O
consistently	O
delegated	O
to	O
library	B-Library
routines	I-Library
.	O
</s>
<s>
The	O
generated	O
code	O
after	O
compilation	B-Language
has	O
relatively	O
straightforward	O
needs	O
on	O
the	O
underlying	O
platform	B-Device
,	O
which	O
makes	O
it	O
suitable	O
for	B-Language
creating	O
operating	B-General_Concept
systems	I-General_Concept
and	O
for	B-Language
use	O
in	O
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
While	O
C	B-Language
does	O
not	O
include	O
certain	O
features	O
found	O
in	O
other	O
languages	O
(	O
such	O
as	O
object	B-Language
orientation	I-Language
and	O
garbage	B-General_Concept
collection	I-General_Concept
)	O
,	O
these	O
can	O
be	O
implemented	B-Language
or	O
emulated	O
,	O
often	O
through	O
the	O
use	O
of	O
external	O
libraries	B-Library
(	O
e.g.	O
,	O
the	O
GLib	B-Language
Object	I-Language
System	I-Language
or	O
the	O
Boehm	B-Language
garbage	I-Language
collector	I-Language
)	O
.	O
</s>
<s>
Many	O
later	O
languages	O
have	O
borrowed	O
directly	O
or	O
indirectly	O
from	O
C	B-Language
,	O
including	O
C++	B-Language
,	O
C#	B-Application
,	O
Unix	B-Application
's	O
C	B-Operating_System
shell	I-Operating_System
,	O
D	B-Application
,	O
Go	B-Application
,	O
Java	B-Language
,	O
JavaScript	B-Language
(	O
including	O
transpilers	B-Language
)	O
,	O
Julia	B-Application
,	O
Limbo	B-Application
,	O
LPC	B-Application
,	O
Objective-C	B-Language
,	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Python	B-Language
,	O
Ruby	B-Language
,	O
Rust	B-Application
,	O
Swift	B-Application
,	O
Verilog	B-Language
and	O
SystemVerilog	B-Language
(	O
hardware	O
description	O
languages	O
)	O
.	O
</s>
<s>
These	O
languages	O
have	O
drawn	O
many	O
of	O
their	O
control	O
structures	O
and	O
other	O
basic	O
features	O
from	O
C	B-Language
.	O
Most	O
of	O
them	O
(	O
Python	B-Language
being	O
a	O
dramatic	O
exception	O
)	O
also	O
express	O
highly	O
similar	O
syntax	O
to	O
C	B-Language
,	O
and	O
they	O
tend	O
to	O
combine	O
the	O
recognizable	O
expression	O
and	O
statement	O
syntax	O
of	O
C	B-Language
with	O
underlying	O
type	O
systems	O
,	O
data	O
models	O
,	O
and	O
semantics	O
that	O
can	O
be	O
radically	O
different	O
.	O
</s>
<s>
The	O
origin	O
of	O
C	B-Language
is	O
closely	O
tied	O
to	O
the	O
development	O
of	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
,	O
originally	O
implemented	B-Language
in	O
assembly	B-Language
language	I-Language
on	O
a	O
PDP-7	B-Device
by	O
Dennis	O
Ritchie	O
and	O
Ken	O
Thompson	O
,	O
incorporating	O
several	O
ideas	O
from	O
colleagues	O
.	O
</s>
<s>
Eventually	O
,	O
they	O
decided	O
to	O
port	O
the	O
operating	B-General_Concept
system	I-General_Concept
to	O
a	O
PDP-11	B-Device
.	O
</s>
<s>
The	O
original	O
PDP-11	B-Device
version	O
of	O
Unix	B-Application
was	O
also	O
developed	O
in	O
assembly	B-Language
language	I-Language
.	O
</s>
<s>
Thompson	O
wanted	O
a	O
programming	O
language	O
for	B-Language
developing	O
utilities	O
for	B-Language
the	O
new	O
platform	B-Device
.	O
</s>
<s>
At	O
first	O
,	O
he	O
tried	O
to	O
write	O
a	O
Fortran	B-Application
compiler	B-Language
,	O
but	O
soon	O
gave	O
up	O
the	O
idea	O
.	O
</s>
<s>
Instead	O
,	O
he	O
created	O
a	O
cut-down	O
version	O
of	O
the	O
recently	O
developed	O
BCPL	B-Language
systems	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
The	O
official	O
description	O
of	O
BCPL	B-Language
was	O
not	O
available	O
at	O
the	O
time	O
and	O
Thompson	O
modified	O
the	O
syntax	O
to	O
be	O
less	O
wordy	O
,	O
and	O
similar	O
to	O
a	O
simplified	O
ALGOL	B-Language
known	O
as	O
SMALGOL	O
.	O
</s>
<s>
Thompson	O
called	O
the	O
result	O
B	B-Language
.	O
</s>
<s>
He	O
described	O
B	B-Language
as	O
"	O
BCPL	B-Language
semantics	O
with	O
a	O
lot	O
of	O
SMALGOL	O
syntax	O
"	O
.	O
</s>
<s>
Like	O
BCPL	B-Language
,	O
B	B-Language
had	O
a	O
bootstrapping	B-Application
compiler	B-Language
to	O
facilitate	O
porting	O
to	O
new	O
machines	O
.	O
</s>
<s>
However	O
,	O
few	O
utilities	O
were	O
ultimately	O
written	O
in	O
B	B-Language
because	O
it	O
was	O
too	O
slow	O
,	O
and	O
could	O
not	O
take	O
advantage	O
of	O
PDP-11	B-Device
features	O
such	O
as	O
byte	B-Application
addressability	O
.	O
</s>
<s>
In	O
1971	O
,	O
Ritchie	O
started	O
to	O
improve	O
B	B-Language
,	O
to	O
utilise	O
the	O
features	O
of	O
the	O
more-powerful	O
PDP-11	B-Device
.	O
</s>
<s>
He	O
called	O
this	O
New	O
B	B-Language
(	O
NB	B-Language
)	O
.	O
</s>
<s>
Thompson	O
started	O
to	O
use	O
NB	B-Language
to	O
write	O
the	O
Unix	B-Application
kernel	B-Operating_System
,	O
and	O
his	O
requirements	O
shaped	O
the	O
direction	O
of	O
the	O
language	O
development	O
.	O
</s>
<s>
Through	O
to	O
1972	O
,	O
richer	O
types	O
were	O
added	O
to	O
the	O
NB	B-Language
language	O
:	O
NB	B-Language
had	O
arrays	O
of	O
int	O
and	O
char	O
.	O
</s>
<s>
A	O
new	O
compiler	B-Language
was	O
written	O
,	O
and	O
the	O
language	O
was	O
renamed	O
C	B-Language
.	O
</s>
<s>
The	O
C	B-Language
compiler	B-Language
and	O
some	O
utilities	O
made	O
with	O
it	O
were	O
included	O
in	O
Version	B-Operating_System
2	I-Operating_System
Unix	I-Operating_System
,	O
which	O
is	O
also	O
known	O
as	O
Research	B-Operating_System
Unix	I-Operating_System
.	O
</s>
<s>
At	O
Version	B-Operating_System
4	I-Operating_System
Unix	I-Operating_System
,	O
released	O
in	O
November	O
1973	O
,	O
the	O
Unix	B-Application
kernel	B-Operating_System
was	O
extensively	O
re-implemented	O
in	O
C	B-Language
.	O
By	O
this	O
time	O
,	O
the	O
C	B-Language
language	I-Language
had	O
acquired	O
some	O
powerful	O
features	O
such	O
as	O
struct	B-Language
types	O
.	O
</s>
<s>
The	O
preprocessor	B-General_Concept
was	O
introduced	O
around	O
1973	O
at	O
the	O
urging	O
of	O
Alan	O
Snyder	O
and	O
also	O
in	O
recognition	O
of	O
the	O
usefulness	O
of	O
the	O
file-inclusion	O
mechanisms	O
available	O
in	O
BCPL	B-Language
and	O
PL/I	B-Language
.	O
</s>
<s>
Its	O
original	O
version	O
provided	O
only	O
included	O
files	O
and	O
simple	O
string	B-Language
replacements	O
:	O
#include	O
and	O
#define	O
of	O
parameterless	O
macros	O
.	O
</s>
<s>
Soon	O
after	O
that	O
,	O
it	O
was	O
extended	O
,	O
mostly	O
by	O
Mike	O
Lesk	O
and	O
then	O
by	O
John	O
Reiser	O
,	O
to	O
incorporate	O
macros	O
with	O
arguments	O
and	O
conditional	B-Application
compilation	I-Application
.	O
</s>
<s>
Unix	B-Application
was	O
one	O
of	O
the	O
first	O
operating	B-Operating_System
system	I-Operating_System
kernels	I-Operating_System
implemented	B-Language
in	O
a	O
language	O
other	O
than	O
assembly	B-Language
.	O
</s>
<s>
Earlier	O
instances	O
include	O
the	O
Multics	B-Application
system	O
(	O
which	O
was	O
written	O
in	O
PL/I	B-Language
)	O
and	O
Master	B-Application
Control	I-Application
Program	I-Application
(	O
MCP	B-Application
)	O
for	B-Language
the	O
Burroughs	B-Device
B5000	I-Device
(	O
which	O
was	O
written	O
in	O
ALGOL	B-Language
)	O
in	O
1961	O
.	O
</s>
<s>
In	O
around	O
1977	O
,	O
Ritchie	O
and	O
Stephen	O
C	B-Language
.	O
Johnson	O
made	O
further	O
changes	O
to	O
the	O
language	O
to	O
facilitate	O
portability	B-Architecture
of	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
.	O
</s>
<s>
Johnson	O
's	O
Portable	B-Application
C	I-Application
Compiler	I-Application
served	O
as	O
the	O
basis	O
for	B-Language
several	O
implementations	O
of	O
C	B-Language
on	O
new	O
platforms	B-Device
.	O
</s>
<s>
In	O
1978	O
,	O
Brian	O
Kernighan	O
and	O
Dennis	O
Ritchie	O
published	O
the	O
first	O
edition	O
of	O
The	O
C	B-Language
Programming	I-Language
Language	I-Language
.	O
</s>
<s>
This	O
book	O
,	O
known	O
to	O
C	B-Language
programmers	O
as	O
K&R	O
,	O
served	O
for	B-Language
many	O
years	O
as	O
an	O
informal	O
specification	O
of	O
the	O
language	O
.	O
</s>
<s>
The	O
version	O
of	O
C	B-Language
that	O
it	O
describes	O
is	O
commonly	O
referred	O
to	O
as	O
"	O
K&R	O
C	B-Language
"	O
.	O
</s>
<s>
The	O
second	O
edition	O
of	O
the	O
book	O
covers	O
the	O
later	O
ANSI	O
C	B-Language
standard	O
,	O
described	O
below	O
.	O
</s>
<s>
Even	O
after	O
the	O
publication	O
of	O
the	O
1989	O
ANSI	O
standard	O
,	O
for	B-Language
many	O
years	O
K&R	O
C	B-Language
was	O
still	O
considered	O
the	O
"	O
lowest	O
common	O
denominator	O
"	O
to	O
which	O
C	B-Language
programmers	O
restricted	O
themselves	O
when	O
maximum	O
portability	B-Architecture
was	O
desired	O
,	O
since	O
many	O
older	O
compilers	B-Language
were	O
still	O
in	O
use	O
,	O
and	O
because	O
carefully	O
written	O
K&R	O
C	B-Language
code	O
can	O
be	O
legal	O
Standard	O
C	B-Language
as	O
well	O
.	O
</s>
<s>
In	O
early	O
versions	O
of	O
C	B-Language
,	O
only	O
functions	O
that	O
return	O
types	O
other	O
than	O
int	O
must	O
be	O
declared	O
if	B-Language
used	O
before	O
the	O
function	O
definition	O
;	O
functions	O
used	O
without	O
prior	O
declaration	O
were	O
presumed	O
to	O
return	O
type	O
int	O
.	O
</s>
<s>
For	B-Language
example	O
:	O
</s>
<s>
The	O
int	O
type	O
specifiers	O
which	O
are	O
commented	O
out	O
could	O
be	O
omitted	O
in	O
K&R	O
C	B-Language
,	O
but	O
are	O
required	O
in	O
later	O
standards	O
.	O
</s>
<s>
Since	O
K&R	O
function	O
declarations	O
did	O
not	O
include	O
any	O
information	O
about	O
function	O
arguments	O
,	O
function	O
parameter	O
type	O
checks	O
were	O
not	O
performed	O
,	O
although	O
some	O
compilers	B-Language
would	O
issue	O
a	O
warning	O
message	O
if	B-Language
a	O
local	O
function	O
was	O
called	O
with	O
the	O
wrong	O
number	O
of	O
arguments	O
,	O
or	O
if	B-Language
multiple	O
calls	O
to	O
an	O
external	O
function	O
used	O
different	O
numbers	O
or	O
types	O
of	O
arguments	O
.	O
</s>
<s>
Separate	O
tools	O
such	O
as	O
Unix	B-Application
's	O
lint	B-Device
utility	O
were	O
developed	O
that	O
(	O
among	O
other	O
things	O
)	O
could	O
check	O
for	B-Language
consistency	O
of	O
function	O
use	O
across	O
multiple	O
source	O
files	O
.	O
</s>
<s>
In	O
the	O
years	O
following	O
the	O
publication	O
of	O
K&R	O
C	B-Language
,	O
several	O
features	O
were	O
added	O
to	O
the	O
language	O
,	O
supported	O
by	O
compilers	B-Language
from	O
AT&T	O
(	O
in	O
particular	O
PCC	B-Application
)	O
and	O
some	O
other	O
vendors	O
.	O
</s>
<s>
enumerated	B-Language
types	I-Language
(	O
previously	O
,	O
preprocessor	B-General_Concept
definitions	O
for	B-Language
integer	O
fixed	O
values	O
were	O
used	O
,	O
e.g.	O
</s>
<s>
The	O
large	O
number	O
of	O
extensions	O
and	O
lack	O
of	O
agreement	O
on	O
a	O
standard	B-Language
library	I-Language
,	O
together	O
with	O
the	O
language	O
popularity	O
and	O
the	O
fact	O
that	O
not	O
even	O
the	O
Unix	B-Application
compilers	B-Language
precisely	O
implemented	B-Language
the	O
K&R	O
specification	O
,	O
led	O
to	O
the	O
necessity	O
of	O
standardization	O
.	O
</s>
<s>
During	O
the	O
late	O
1970s	O
and	O
1980s	O
,	O
versions	O
of	O
C	B-Language
were	O
implemented	B-Language
for	B-Language
a	O
wide	O
variety	O
of	O
mainframe	B-Architecture
computers	I-Architecture
,	O
minicomputers	B-Architecture
,	O
and	O
microcomputers	B-Architecture
,	O
including	O
the	O
IBM	B-Device
PC	I-Device
,	O
as	O
its	O
popularity	O
began	O
to	O
increase	O
significantly	O
.	O
</s>
<s>
In	O
1983	O
,	O
the	O
American	O
National	O
Standards	O
Institute	O
(	O
ANSI	O
)	O
formed	O
a	O
committee	O
,	O
X3J11	O
,	O
to	O
establish	O
a	O
standard	O
specification	O
of	O
C	B-Language
.	O
X3J11	O
based	O
the	O
C	B-Language
standard	O
on	O
the	O
Unix	B-Application
implementation	O
;	O
however	O
,	O
the	O
non-portable	O
portion	O
of	O
the	O
Unix	B-Application
C	B-Language
library	I-Language
was	O
handed	O
off	O
to	O
the	O
IEEE	O
working	O
group	O
1003	O
to	O
become	O
the	O
basis	O
for	B-Language
the	O
1988	O
POSIX	O
standard	O
.	O
</s>
<s>
In	O
1989	O
,	O
the	O
C	B-Language
standard	O
was	O
ratified	O
as	O
ANSI	O
X3.159-1989	O
"	O
Programming	B-Language
Language	I-Language
C	I-Language
"	O
.	O
</s>
<s>
This	O
version	O
of	O
the	O
language	O
is	O
often	O
referred	O
to	O
as	O
ANSI	O
C	B-Language
,	O
Standard	O
C	B-Language
,	O
or	O
sometimes	O
C89	O
.	O
</s>
<s>
In	O
1990	O
,	O
the	O
ANSI	O
C	B-Language
standard	O
(	O
with	O
formatting	O
changes	O
)	O
was	O
adopted	O
by	O
the	O
International	O
Organization	O
for	B-Language
Standardization	O
(	O
ISO	O
)	O
as	O
ISO/IEC	O
9899:1990	O
,	O
which	O
is	O
sometimes	O
called	O
C90	O
.	O
</s>
<s>
ANSI	O
,	O
like	O
other	O
national	O
standards	O
bodies	O
,	O
no	O
longer	O
develops	O
the	O
C	B-Language
standard	O
independently	O
,	O
but	O
defers	O
to	O
the	O
international	O
C	B-Language
standard	O
,	O
maintained	O
by	O
the	O
working	O
group	O
ISO/IEC	O
JTC1/SC22/WG14	O
.	O
</s>
<s>
One	O
of	O
the	O
aims	O
of	O
the	O
C	B-Language
standardization	O
process	O
was	O
to	O
produce	O
a	O
superset	O
of	O
K&R	O
C	B-Language
,	O
incorporating	O
many	O
of	O
the	O
subsequently	O
introduced	O
unofficial	O
features	O
.	O
</s>
<s>
The	O
standards	O
committee	O
also	O
included	O
several	O
additional	O
features	O
such	O
as	O
function	O
prototypes	O
(	O
borrowed	O
from	O
C++	B-Language
)	O
,	O
void	O
pointers	O
,	O
support	O
for	B-Language
international	B-General_Concept
character	I-General_Concept
sets	I-General_Concept
and	O
locales	B-Device
,	O
and	O
preprocessor	B-General_Concept
enhancements	O
.	O
</s>
<s>
Although	O
the	O
syntax	O
for	B-Language
parameter	O
declarations	O
was	O
augmented	O
to	O
include	O
the	O
style	O
used	O
in	O
C++	B-Language
,	O
the	O
K&R	O
interface	O
continued	O
to	O
be	O
permitted	O
,	O
for	B-Language
compatibility	O
with	O
existing	O
source	O
code	O
.	O
</s>
<s>
C89	O
is	O
supported	O
by	O
current	O
C	B-Language
compilers	B-Language
,	O
and	O
most	O
modern	O
C	B-Language
code	O
is	O
based	O
on	O
it	O
.	O
</s>
<s>
Any	O
program	O
written	O
only	O
in	O
Standard	O
C	B-Language
and	O
without	O
any	O
hardware-dependent	O
assumptions	O
will	O
run	O
correctly	O
on	O
any	O
platform	B-Device
with	O
a	O
conforming	O
C	B-Language
implementation	O
,	O
within	O
its	O
resource	O
limits	O
.	O
</s>
<s>
Without	O
such	O
precautions	O
,	O
programs	O
may	O
compile	B-Language
only	O
on	O
a	O
certain	O
platform	B-Device
or	O
with	O
a	O
particular	O
compiler	B-Language
,	O
due	O
,	O
for	B-Language
example	O
,	O
to	O
the	O
use	O
of	O
non-standard	O
libraries	B-Library
,	O
such	O
as	O
GUI	B-Application
libraries	B-Library
,	O
or	O
to	O
a	O
reliance	O
on	O
compiler	B-Language
-	O
or	O
platform-specific	O
attributes	O
such	O
as	O
the	O
exact	O
size	O
of	O
data	O
types	O
and	O
byte	B-Application
endianness	O
.	O
</s>
<s>
In	O
cases	O
where	O
code	O
must	O
be	O
compilable	O
by	O
either	O
standard-conforming	O
or	O
K&R	O
C-based	O
compilers	B-Language
,	O
the	O
__STDC__	O
macro	O
can	O
be	O
used	O
to	O
split	O
the	O
code	O
into	O
Standard	O
and	O
K&R	O
sections	O
to	O
prevent	O
the	O
use	O
on	O
a	O
K&R	O
C-based	O
compiler	B-Language
of	O
features	O
available	O
only	O
in	O
Standard	O
C	B-Language
.	O
</s>
<s>
After	O
the	O
ANSI/ISO	O
standardization	O
process	O
,	O
the	O
C	B-Language
language	I-Language
specification	O
remained	O
relatively	O
static	B-Language
for	B-Language
several	O
years	O
.	O
</s>
<s>
In	O
1995	O
,	O
Normative	O
Amendment	O
1	O
to	O
the	O
1990	O
C	B-Language
standard	O
(	O
ISO/IEC	O
9899/AMD1:1995	O
,	O
known	O
informally	O
as	O
C95	O
)	O
was	O
published	O
,	O
to	O
correct	O
some	O
details	O
and	O
to	O
add	O
more	O
extensive	O
support	O
for	B-Language
international	B-General_Concept
character	I-General_Concept
sets	I-General_Concept
.	O
</s>
<s>
The	O
C	B-Language
standard	O
was	O
further	O
revised	O
in	O
the	O
late	O
1990s	O
,	O
leading	O
to	O
the	O
publication	O
of	O
ISO/IEC	B-Language
9899:1999	I-Language
in	O
1999	O
,	O
which	O
is	O
commonly	O
referred	O
to	O
as	O
"	O
C99	B-Language
"	O
.	O
</s>
<s>
C99	B-Language
introduced	O
several	O
new	O
features	O
,	O
including	O
inline	O
functions	O
,	O
several	O
new	O
data	O
types	O
(	O
including	O
long	O
long	O
int	O
and	O
a	O
complex	O
type	O
to	O
represent	O
complex	O
numbers	O
)	O
,	O
variable-length	B-Data_Structure
arrays	I-Data_Structure
and	O
flexible	B-Language
array	I-Language
members	I-Language
,	O
improved	O
support	O
for	B-Language
IEEE	O
754	O
floating	B-Algorithm
point	I-Algorithm
,	O
support	O
for	B-Language
variadic	B-Language
macros	I-Language
(	O
macros	O
of	O
variable	O
arity	O
)	O
,	O
and	O
support	O
for	B-Language
one-line	O
comments	O
beginning	O
with	O
//	O
,	O
as	O
in	O
BCPL	B-Language
or	O
C++	B-Language
.	O
</s>
<s>
Many	O
of	O
these	O
had	O
already	O
been	O
implemented	B-Language
as	O
extensions	O
in	O
several	O
C	B-Language
compilers	B-Language
.	O
</s>
<s>
C99	B-Language
is	O
for	B-Language
the	O
most	O
part	O
backward	O
compatible	O
with	O
C90	O
,	O
but	O
is	O
stricter	O
in	O
some	O
ways	O
;	O
in	O
particular	O
,	O
a	O
declaration	O
that	O
lacks	O
a	O
type	O
specifier	O
no	O
longer	O
has	O
int	O
implicitly	O
assumed	O
.	O
</s>
<s>
A	O
standard	O
macro	O
__STDC_VERSION__	O
is	O
defined	O
with	O
value	O
199901L	O
to	O
indicate	O
that	O
C99	B-Language
support	O
is	O
available	O
.	O
</s>
<s>
GCC	B-Application
,	O
Solaris	B-Application
Studio	I-Application
,	O
and	O
other	O
C	B-Language
compilers	B-Language
now	O
support	O
many	O
or	O
all	O
of	O
the	O
new	O
features	O
of	O
C99	B-Language
.	O
</s>
<s>
The	O
C	B-Language
compiler	B-Language
in	O
Microsoft	B-Application
Visual	I-Application
C++	I-Application
,	O
however	O
,	O
implements	O
the	O
C89	O
standard	O
and	O
those	O
parts	O
of	O
C99	B-Language
that	O
are	O
required	O
for	B-Language
compatibility	O
with	O
C++11	B-Language
.	I-Language
</s>
<s>
In	O
addition	O
,	O
the	O
C99	B-Language
standard	I-Language
requires	O
support	O
for	B-Language
Unicode	O
identifiers	O
in	O
the	O
form	O
of	O
escaped	O
characters	O
(	O
e.g.	O
</s>
<s>
or	O
)	O
and	O
suggests	O
support	O
for	B-Language
raw	O
Unicode	O
names	O
.	O
</s>
<s>
In	O
2007	O
,	O
work	O
began	O
on	O
another	O
revision	O
of	O
the	O
C	B-Language
standard	O
,	O
informally	O
called	O
"	O
C1X	O
"	O
until	O
its	O
official	O
publication	O
of	O
ISO/IEC	O
9899:2011	O
on	O
2011-12-08	O
.	O
</s>
<s>
The	O
C	B-Language
standards	O
committee	O
adopted	O
guidelines	O
to	O
limit	O
the	O
adoption	O
of	O
new	O
features	O
that	O
had	O
not	O
been	O
tested	O
by	O
existing	O
implementations	O
.	O
</s>
<s>
The	O
C11	O
standard	O
adds	O
numerous	O
new	O
features	O
to	O
C	B-Language
and	O
the	O
library	B-Library
,	O
including	O
type	O
generic	O
macros	O
,	O
anonymous	O
structures	O
,	O
improved	O
Unicode	O
support	O
,	O
atomic	O
operations	O
,	O
multi-threading	O
,	O
and	O
bounds-checked	O
functions	O
.	O
</s>
<s>
It	O
also	O
makes	O
some	O
portions	O
of	O
the	O
existing	O
C99	B-Language
library	B-Library
optional	O
,	O
and	O
improves	O
compatibility	O
with	O
C++	B-Language
.	O
</s>
<s>
Published	O
in	O
June	O
2018	O
as	O
ISO/IEC	O
9899:2018	O
,	O
C17	O
is	O
the	O
current	O
standard	O
for	B-Language
the	O
C	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
C2x	B-Language
is	O
an	O
informal	O
name	O
for	B-Language
the	O
next	O
(	O
after	O
C17	O
)	O
major	O
C	B-Language
language	I-Language
standard	O
revision	O
.	O
</s>
<s>
It	O
is	O
expected	O
to	O
be	O
voted	O
on	O
in	O
2023	O
and	O
would	O
therefore	O
be	O
called	O
C23	B-Language
.	O
</s>
<s>
Historically	O
,	O
embedded	O
C	B-Language
programming	I-Language
requires	O
nonstandard	O
extensions	O
to	O
the	O
C	B-Language
language	I-Language
in	O
order	O
to	O
support	O
exotic	O
features	O
such	O
as	O
fixed-point	O
arithmetic	O
,	O
multiple	O
distinct	O
memory	B-General_Concept
banks	O
,	O
and	O
basic	O
I/O	B-General_Concept
operations	I-General_Concept
.	O
</s>
<s>
In	O
2008	O
,	O
the	O
C	B-Language
Standards	O
Committee	O
published	O
a	O
technical	O
report	O
extending	O
the	O
C	B-Language
language	I-Language
to	O
address	O
these	O
issues	O
by	O
providing	O
a	O
common	O
standard	O
for	B-Language
all	O
implementations	O
to	O
adhere	O
to	O
.	O
</s>
<s>
It	O
includes	O
a	O
number	O
of	O
features	O
not	O
available	O
in	O
normal	O
C	B-Language
,	O
such	O
as	O
fixed-point	O
arithmetic	O
,	O
named	O
address	O
spaces	O
,	O
and	O
basic	O
I/O	B-General_Concept
hardware	I-General_Concept
addressing	O
.	O
</s>
<s>
C	B-Language
has	O
a	O
formal	O
grammar	O
specified	O
by	O
the	O
C	B-Language
standard	O
.	O
</s>
<s>
Line	O
endings	O
are	O
generally	O
not	O
significant	O
in	O
C	B-Language
;	O
however	O
,	O
line	O
boundaries	O
do	O
have	O
significance	O
during	O
the	O
preprocessing	O
phase	O
.	O
</s>
<s>
Comments	O
may	O
appear	O
either	O
between	O
the	O
delimiters	O
/	O
*	O
and	O
*	O
/	O
,	O
or	O
(	O
since	O
C99	B-Language
)	O
following	O
//	O
until	O
the	O
end	O
of	O
the	O
line	O
.	O
</s>
<s>
Comments	O
delimited	O
by	O
/	O
*	O
and	O
*	O
/	O
do	O
not	O
nest	O
,	O
and	O
these	O
sequences	O
of	O
characters	O
are	O
not	O
interpreted	O
as	O
comment	O
delimiters	O
if	B-Language
they	O
appear	O
inside	O
string	B-Language
or	O
character	O
literals	O
.	O
</s>
<s>
C	B-Language
source	O
files	O
contain	O
declarations	O
and	O
function	O
definitions	O
.	O
</s>
<s>
Declarations	O
either	O
define	O
new	O
types	O
using	O
keywords	O
such	O
as	O
struct	B-Language
,	O
union	O
,	O
and	O
enum	B-Language
,	O
or	O
assign	O
types	O
to	O
and	O
perhaps	O
reserve	O
storage	B-General_Concept
for	B-Language
new	O
variables	O
,	O
usually	O
by	O
writing	O
the	O
type	O
followed	O
by	O
the	O
variable	O
name	O
.	O
</s>
<s>
Sections	O
of	O
code	O
are	O
enclosed	O
in	O
braces	O
( {	O
and	O
}	O
,	O
sometimes	O
called	O
"	O
curly	O
brackets	O
"	O
)	O
to	O
limit	O
the	O
scope	O
of	O
declarations	O
and	O
to	O
act	O
as	O
a	O
single	O
statement	O
for	B-Language
control	O
structures	O
.	O
</s>
<s>
As	O
an	O
imperative	B-Application
language	I-Application
,	O
C	B-Language
uses	O
statements	O
to	O
specify	O
actions	O
.	O
</s>
<s>
To	O
modify	O
the	O
normal	O
sequential	O
execution	O
of	O
statements	O
,	O
C	B-Language
provides	O
several	O
control-flow	O
statements	O
identified	O
by	O
reserved	O
keywords	O
.	O
</s>
<s>
Structured	B-Language
programming	I-Language
is	O
supported	O
by	O
if	B-Language
...	O
 [ else ] 	O
conditional	B-Language
execution	O
and	O
by	O
do	O
...	O
while	O
,	O
while	O
,	O
and	O
for	B-Language
iterative	O
execution	O
(	O
looping	O
)	O
.	O
</s>
<s>
The	O
for	B-Language
statement	I-Language
has	O
separate	O
initialization	O
,	O
testing	O
,	O
and	O
reinitialization	O
expressions	O
,	O
any	O
or	O
all	O
of	O
which	O
can	O
be	O
omitted	O
.	O
</s>
<s>
There	O
is	O
also	O
a	O
non-structured	O
goto	B-Application
statement	O
which	O
branches	O
directly	O
to	O
the	O
designated	O
label	O
within	O
the	O
function	O
.	O
</s>
<s>
However	O
,	O
all	O
side	O
effects	O
(	O
including	O
storage	B-General_Concept
to	O
variables	O
)	O
will	O
occur	O
before	O
the	O
next	O
"	O
sequence	B-Application
point	I-Application
"	O
;	O
sequence	B-Application
points	I-Application
include	O
the	O
end	O
of	O
each	O
expression	O
statement	O
,	O
and	O
the	O
entry	O
to	O
and	O
return	O
from	O
each	O
function	O
call	O
.	O
</s>
<s>
Sequence	B-Application
points	I-Application
also	O
occur	O
during	O
evaluation	O
of	O
expressions	O
containing	O
certain	O
operators	O
( &&	O
,	O
||	O
,	O
?	O
</s>
<s>
:	O
and	O
the	O
comma	B-Language
operator	I-Language
)	O
.	O
</s>
<s>
This	O
permits	O
a	O
high	O
degree	O
of	O
object	B-Language
code	I-Language
optimization	O
by	O
the	O
compiler	B-Language
,	O
but	O
requires	O
C	B-Language
programmers	O
to	O
take	O
more	O
care	O
to	O
obtain	O
reliable	O
results	O
than	O
is	O
needed	O
for	B-Language
other	O
programming	O
languages	O
.	O
</s>
<s>
Kernighan	O
and	O
Ritchie	O
say	O
in	O
the	O
Introduction	O
of	O
The	O
C	B-Language
Programming	I-Language
Language	I-Language
:	O
"	O
C	B-Language
,	O
like	O
any	O
other	O
language	O
,	O
has	O
its	O
blemishes	O
.	O
</s>
<s>
The	O
C	B-Language
standard	O
did	O
not	O
attempt	O
to	O
correct	O
many	O
of	O
these	O
blemishes	O
,	O
because	O
of	O
the	O
impact	O
of	O
such	O
changes	O
on	O
already	O
existing	O
software	O
.	O
</s>
<s>
The	O
basic	O
C	B-Language
source	O
character	B-General_Concept
set	I-General_Concept
includes	O
the	O
following	O
characters	O
:	O
</s>
<s>
Newline	O
indicates	O
the	O
end	O
of	O
a	O
text	O
line	O
;	O
it	O
need	O
not	O
correspond	O
to	O
an	O
actual	O
single	O
character	O
,	O
although	O
for	B-Language
convenience	O
C	B-Language
treats	O
it	O
as	O
one	O
.	O
</s>
<s>
Additional	O
multi-byte	O
encoded	O
characters	O
may	O
be	O
used	O
in	O
string	B-Language
literals	I-Language
,	O
but	O
they	O
are	O
not	O
entirely	O
portable	B-Architecture
.	O
</s>
<s>
The	O
latest	O
C	B-Language
standard	O
(	O
C11	O
)	O
allows	O
multi-national	O
Unicode	O
characters	O
to	O
be	O
embedded	O
portably	O
within	O
C	B-Language
source	O
text	O
by	O
using	O
\uXXXX	O
or	O
\UXXXXXXXX	O
encoding	O
(	O
where	O
the	O
X	O
denotes	O
a	O
hexadecimal	O
character	O
)	O
,	O
although	O
this	O
feature	O
is	O
not	O
yet	O
widely	O
implemented	B-Language
.	O
</s>
<s>
The	O
basic	O
C	B-Language
execution	O
character	B-General_Concept
set	I-General_Concept
contains	O
the	O
same	O
characters	O
,	O
along	O
with	O
representations	O
for	B-Language
alert	O
,	O
backspace	B-Device
,	O
and	O
carriage	O
return	O
.	O
</s>
<s>
Run-time	B-Library
support	O
for	B-Language
extended	O
character	B-General_Concept
sets	I-General_Concept
has	O
increased	O
with	O
each	O
revision	O
of	O
the	O
C	B-Language
standard	O
.	O
</s>
<s>
C89	O
has	O
32	O
reserved	O
words	O
,	O
also	O
known	O
as	O
keywords	O
,	O
which	O
are	O
the	O
words	O
that	O
cannot	O
be	O
used	O
for	B-Language
any	O
purposes	O
other	O
than	O
those	O
for	B-Language
which	O
they	O
are	O
predefined	O
:	O
</s>
<s>
C99	B-Language
reserved	O
five	O
more	O
words	O
:	O
</s>
<s>
Most	O
of	O
the	O
recently	O
reserved	O
words	O
begin	O
with	O
an	O
underscore	O
followed	O
by	O
a	O
capital	O
letter	O
,	O
because	O
identifiers	O
of	O
that	O
form	O
were	O
previously	O
reserved	O
by	O
the	O
C	B-Language
standard	O
for	B-Language
use	O
only	O
by	O
implementations	O
.	O
</s>
<s>
Since	O
existing	O
program	O
source	O
code	O
should	O
not	O
have	O
been	O
using	O
these	O
identifiers	O
,	O
it	O
would	O
not	O
be	O
affected	O
when	O
C	B-Language
implementations	O
started	O
supporting	O
these	O
extensions	O
to	O
the	O
programming	O
language	O
.	O
</s>
<s>
Some	O
standard	O
headers	O
do	O
define	O
more	O
convenient	O
synonyms	O
for	B-Language
underscored	O
identifiers	O
.	O
</s>
<s>
The	O
language	O
previously	O
included	O
a	O
reserved	O
word	O
called	O
entry	O
,	O
but	O
this	O
was	O
seldom	O
implemented	B-Language
,	O
and	O
has	O
now	O
been	O
removed	O
as	O
a	O
reserved	O
word	O
.	O
</s>
<s>
C	B-Language
supports	O
a	O
rich	O
set	O
of	O
operators	O
,	O
which	O
are	O
symbols	O
used	O
within	O
an	O
expression	O
to	O
specify	O
the	O
manipulations	O
to	O
be	O
performed	O
while	O
evaluating	O
that	O
expression	O
.	O
</s>
<s>
C	B-Language
has	O
operators	O
for	B-Language
:	O
</s>
<s>
conditional	B-Language
evaluation	O
:	O
?	O
</s>
<s>
C	B-Language
uses	O
the	O
operator	O
=	O
(	O
used	O
in	O
mathematics	O
to	O
express	O
equality	O
)	O
to	O
indicate	O
assignment	O
,	O
following	O
the	O
precedent	O
of	O
Fortran	B-Application
and	O
PL/I	B-Language
,	O
but	O
unlike	O
ALGOL	B-Language
and	O
its	O
derivatives	O
.	O
</s>
<s>
C	B-Language
uses	O
the	O
operator	O
==	O
to	O
test	O
for	B-Language
equality	O
.	O
</s>
<s>
The	O
similarity	O
between	O
these	O
two	O
operators	O
(	O
assignment	O
and	O
equality	O
)	O
may	O
result	O
in	O
the	O
accidental	O
use	O
of	O
one	O
in	O
place	O
of	O
the	O
other	O
,	O
and	O
in	O
many	O
cases	O
,	O
the	O
mistake	O
does	O
not	O
produce	O
an	O
error	O
message	O
(	O
although	O
some	O
compilers	B-Language
produce	O
warnings	O
)	O
.	O
</s>
<s>
For	B-Language
example	O
,	O
the	O
conditional	B-Language
expression	O
if	B-Language
(	O
a	O
==	O
b	B-Language
+	O
1	O
)	O
might	O
mistakenly	O
be	O
written	O
as	O
if	B-Language
(	O
a	O
=	O
b	B-Language
+	O
1	O
)	O
,	O
which	O
will	O
be	O
evaluated	O
as	O
true	O
if	B-Language
a	O
is	O
not	O
zero	O
after	O
the	O
assignment	O
.	O
</s>
<s>
The	O
C	B-Language
operator	O
precedence	O
is	O
not	O
always	O
intuitive	O
.	O
</s>
<s>
For	B-Language
example	O
,	O
the	O
operator	O
==	O
binds	O
more	O
tightly	O
than	O
(	O
is	O
executed	O
prior	O
to	O
)	O
the	O
operators	O
&	O
(	O
bitwise	O
AND	O
)	O
and	O
|	O
(	O
bitwise	O
OR	O
)	O
in	O
expressions	O
such	O
as	O
x	O
&	O
1	O
==	O
0	O
,	O
which	O
must	O
be	O
written	O
as	O
(	O
x	O
&	O
1	O
)	O
==	O
0	O
if	B-Language
that	O
is	O
the	O
coder	O
's	O
intent	O
.	O
</s>
<s>
The	O
"	O
hello	O
,	O
world	O
"	O
example	O
,	O
which	O
appeared	O
in	O
the	O
first	O
edition	O
of	O
K&R	O
,	O
has	O
become	O
the	O
model	O
for	B-Language
an	O
introductory	O
program	O
in	O
most	O
programming	O
textbooks	O
.	O
</s>
<s>
The	O
first	O
line	O
of	O
the	O
program	O
contains	O
a	O
preprocessing	B-General_Concept
directive	I-General_Concept
,	O
indicated	O
by	O
#include	O
.	O
</s>
<s>
This	O
causes	O
the	O
compiler	B-Language
to	O
replace	O
that	O
line	O
with	O
the	O
entire	O
text	O
of	O
the	O
stdio.h	B-Language
standard	O
header	O
,	O
which	O
contains	O
declarations	O
for	B-Language
standard	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
functions	O
such	O
as	O
printf	B-Language
and	O
scanf	O
.	O
</s>
<s>
The	O
angle	O
brackets	O
surrounding	O
stdio.h	B-Language
indicate	O
that	O
stdio.h	B-Language
can	O
be	O
located	O
using	O
a	O
search	O
strategy	O
that	O
prefers	O
headers	O
provided	O
with	O
the	O
compiler	B-Language
to	O
other	O
headers	O
having	O
the	O
same	O
name	O
,	O
as	O
opposed	O
to	O
double	O
quotes	O
which	O
typically	O
include	O
local	O
or	O
project-specific	O
header	B-Language
files	I-Language
.	O
</s>
<s>
The	O
next	O
line	O
indicates	O
that	O
a	O
function	O
named	O
main	B-Language
is	O
being	O
defined	O
.	O
</s>
<s>
The	O
main	B-Language
function	I-Language
serves	O
a	O
special	O
purpose	O
in	O
C	B-Language
programs	I-Language
;	O
the	O
run-time	B-Device
environment	I-Device
calls	O
the	O
main	B-Language
function	I-Language
to	O
begin	O
program	O
execution	O
.	O
</s>
<s>
The	O
type	O
specifier	O
int	O
indicates	O
that	O
the	O
value	O
that	O
is	O
returned	O
to	O
the	O
invoker	O
(	O
in	O
this	O
case	O
the	O
run-time	B-Device
environment	I-Device
)	O
as	O
a	O
result	O
of	O
evaluating	O
the	O
main	B-Language
function	I-Language
,	O
is	O
an	O
integer	O
.	O
</s>
<s>
The	O
opening	O
curly	O
brace	O
indicates	O
the	O
beginning	O
of	O
the	O
definition	O
of	O
the	O
main	B-Language
function	I-Language
.	O
</s>
<s>
The	O
next	O
line	O
calls	O
(	O
diverts	O
execution	O
to	O
)	O
a	O
function	O
named	O
printf	B-Language
,	O
which	O
in	O
this	O
case	O
is	O
supplied	O
from	O
a	O
system	B-Library
library	I-Library
.	O
</s>
<s>
In	O
this	O
call	O
,	O
the	O
printf	B-Language
function	O
is	O
passed	O
(	O
provided	O
with	O
)	O
a	O
single	O
argument	O
,	O
the	O
address	O
of	O
the	O
first	O
character	O
in	O
the	O
string	B-Language
literal	I-Language
"	O
hello	O
,	O
world	O
\n	O
 "	O
.	O
</s>
<s>
The	O
string	B-Language
literal	I-Language
is	O
an	O
unnamed	O
array	O
with	O
elements	O
of	O
type	O
char	O
,	O
set	O
up	O
automatically	O
by	O
the	O
compiler	B-Language
with	O
a	O
final	O
0-valued	O
character	O
to	O
mark	O
the	O
end	O
of	O
the	O
array	O
(	O
printf	B-Language
needs	O
to	O
know	O
this	O
)	O
.	O
</s>
<s>
The	O
\n	O
is	O
an	O
escape	B-Language
sequence	I-Language
that	O
C	B-Language
translates	O
to	O
a	O
newline	O
character	O
,	O
which	O
on	O
output	O
signifies	O
the	O
end	O
of	O
the	O
current	O
line	O
.	O
</s>
<s>
The	O
return	O
value	O
of	O
the	O
printf	B-Language
function	O
is	O
of	O
type	O
int	O
,	O
but	O
it	O
is	O
silently	O
discarded	O
since	O
it	O
is	O
not	O
used	O
.	O
</s>
<s>
(	O
A	O
more	O
careful	O
program	O
might	O
test	O
the	O
return	O
value	O
to	O
determine	O
whether	O
or	O
not	O
the	O
printf	B-Language
function	O
succeeded	O
.	O
)	O
</s>
<s>
The	O
closing	O
curly	O
brace	O
indicates	O
the	O
end	O
of	O
the	O
code	O
for	B-Language
the	O
main	B-Language
function	I-Language
.	O
</s>
<s>
According	O
to	O
the	O
C99	B-Language
specification	O
and	O
newer	O
,	O
the	O
main	B-Language
function	I-Language
,	O
unlike	O
any	O
other	O
function	O
,	O
will	O
implicitly	O
return	O
a	O
value	O
of	O
0	O
upon	O
reaching	O
the	O
}	O
that	O
terminates	O
the	O
function	O
.	O
</s>
<s>
This	O
is	O
interpreted	O
by	O
the	O
run-time	B-Device
system	I-Device
as	O
an	O
exit	O
code	O
indicating	O
successful	O
execution	O
.	O
</s>
<s>
The	O
type	O
system	O
in	O
C	B-Language
is	O
static	B-Language
and	O
weakly	O
typed	O
,	O
which	O
makes	O
it	O
similar	O
to	O
the	O
type	O
system	O
of	O
ALGOL	B-Language
descendants	O
such	O
as	O
Pascal	B-Application
.	O
</s>
<s>
There	O
are	O
built-in	O
types	O
for	B-Language
integers	O
of	O
various	O
sizes	O
,	O
both	O
signed	B-Algorithm
and	O
unsigned	B-Algorithm
,	O
floating-point	B-Algorithm
numbers	I-Algorithm
,	O
and	O
enumerated	B-Language
types	I-Language
(	O
enum	B-Language
)	O
.	O
</s>
<s>
Integer	O
type	O
char	O
is	O
often	O
used	O
for	B-Language
single-byte	O
characters	O
.	O
</s>
<s>
C99	B-Language
added	O
a	O
boolean	O
datatype	O
.	O
</s>
<s>
There	O
are	O
also	O
derived	O
types	O
including	O
arrays	O
,	O
pointers	O
,	O
records	O
(	O
struct	B-Language
)	O
,	O
and	O
unions	O
(	O
union	O
)	O
.	O
</s>
<s>
C	B-Language
is	O
often	O
used	O
in	O
low-level	B-Language
systems	B-Application
programming	I-Application
where	O
escapes	O
from	O
the	O
type	O
system	O
may	O
be	O
necessary	O
.	O
</s>
<s>
The	O
compiler	B-Language
attempts	O
to	O
ensure	O
type	O
correctness	O
of	O
most	O
expressions	O
,	O
but	O
the	O
programmer	O
can	O
override	O
the	O
checks	O
in	O
various	O
ways	O
,	O
either	O
by	O
using	O
a	O
type	O
cast	O
to	O
explicitly	O
convert	O
a	O
value	O
from	O
one	O
type	O
to	O
another	O
,	O
or	O
by	O
using	O
pointers	O
or	O
unions	O
to	O
reinterpret	O
the	O
underlying	O
bits	O
of	O
a	O
data	O
object	O
in	O
some	O
other	O
way	O
.	O
</s>
<s>
Some	O
find	O
C	B-Language
's	O
declaration	O
syntax	O
unintuitive	O
,	O
particularly	O
for	B-Language
function	B-Language
pointers	I-Language
.	O
</s>
<s>
(	O
Ritchie	O
's	O
idea	O
was	O
to	O
declare	O
identifiers	O
in	O
contexts	O
resembling	O
their	O
use	O
:	O
"	O
declaration	B-Language
reflects	I-Language
use	I-Language
"	O
.	O
)	O
</s>
<s>
C	B-Language
's	O
usual	O
arithmetic	O
conversions	O
allow	O
for	B-Language
efficient	O
code	O
to	O
be	O
generated	O
,	O
but	O
can	O
sometimes	O
produce	O
unexpected	O
results	O
.	O
</s>
<s>
For	B-Language
example	O
,	O
a	O
comparison	O
of	O
signed	B-Algorithm
and	O
unsigned	B-Algorithm
integers	O
of	O
equal	O
width	O
requires	O
a	O
conversion	O
of	O
the	O
signed	B-Algorithm
value	O
to	O
unsigned	B-Algorithm
.	O
</s>
<s>
This	O
can	O
generate	O
unexpected	O
results	O
if	B-Language
the	O
signed	B-Algorithm
value	O
is	O
negative	O
.	O
</s>
<s>
C	B-Language
supports	O
the	O
use	O
of	O
pointers	O
,	O
a	O
type	O
of	O
reference	O
that	O
records	O
the	O
address	O
or	O
location	O
of	O
an	O
object	O
or	O
function	O
in	O
memory	B-General_Concept
.	O
</s>
<s>
The	O
run-time	B-Library
representation	O
of	O
a	O
pointer	O
value	O
is	O
typically	O
a	O
raw	O
memory	B-General_Concept
address	O
(	O
perhaps	O
augmented	O
by	O
an	O
offset-within-word	O
field	O
)	O
,	O
but	O
since	O
a	O
pointer	O
's	O
type	O
includes	O
the	O
type	O
of	O
the	O
thing	O
pointed	O
to	O
,	O
expressions	O
including	O
pointers	O
can	O
be	O
type-checked	O
at	O
compile	B-Language
time	O
.	O
</s>
<s>
Pointers	O
are	O
used	O
for	B-Language
many	O
purposes	O
in	O
C	B-Language
.	O
Text	O
strings	O
are	O
commonly	O
manipulated	O
using	O
pointers	O
into	O
arrays	O
of	O
characters	O
.	O
</s>
<s>
Dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
is	O
performed	O
using	O
pointers	O
;	O
the	O
result	O
of	O
a	O
malloc	B-Language
is	O
usually	O
cast	O
to	O
the	O
data	O
type	O
of	O
the	O
data	O
to	O
be	O
stored	O
.	O
</s>
<s>
Many	O
data	O
types	O
,	O
such	O
as	O
trees	B-Application
,	O
are	O
commonly	O
implemented	B-Language
as	O
dynamically	O
allocated	B-Application
struct	B-Language
objects	O
linked	B-Application
together	O
using	O
pointers	O
.	O
</s>
<s>
Pointers	O
to	O
other	O
pointers	O
are	O
often	O
used	O
in	O
multi-dimensional	O
arrays	O
and	O
arrays	O
of	O
struct	B-Language
objects	O
.	O
</s>
<s>
Pointers	O
to	O
functions	O
(	O
function	B-Language
pointers	I-Language
)	O
are	O
useful	O
for	B-Language
passing	O
functions	O
as	O
arguments	O
to	O
higher-order	B-Language
functions	I-Language
(	O
such	O
as	O
qsort	B-Language
or	O
bsearch	O
)	O
,	O
in	O
dispatch	O
tables	O
,	O
or	O
as	O
callbacks	O
to	O
event	O
handlers	O
.	O
</s>
<s>
Dereferencing	O
a	O
null	O
pointer	O
value	O
is	O
undefined	O
,	O
often	O
resulting	O
in	O
a	O
segmentation	B-Error_Name
fault	I-Error_Name
.	O
</s>
<s>
Null	O
pointer	O
values	O
are	O
useful	O
for	B-Language
indicating	O
special	O
cases	O
such	O
as	O
no	O
"	O
next	O
"	O
pointer	O
in	O
the	O
final	O
node	O
of	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
,	O
or	O
as	O
an	O
error	O
indication	O
from	O
functions	O
returning	O
pointers	O
.	O
</s>
<s>
In	O
appropriate	O
contexts	O
in	O
source	O
code	O
,	O
such	O
as	O
for	B-Language
assigning	O
to	O
a	O
pointer	O
variable	O
,	O
a	O
null	O
pointer	O
constant	O
can	O
be	O
written	O
as	O
0	O
,	O
with	O
or	O
without	O
explicit	O
casting	O
to	O
a	O
pointer	O
type	O
,	O
or	O
as	O
the	O
NULL	O
macro	O
defined	O
by	O
several	O
standard	O
headers	O
.	O
</s>
<s>
In	O
conditional	B-Language
contexts	O
,	O
null	O
pointer	O
values	O
evaluate	O
to	O
false	O
,	O
while	O
all	O
other	O
pointer	O
values	O
evaluate	O
to	O
true	O
.	O
</s>
<s>
Although	O
properly	O
used	O
pointers	O
point	O
to	O
safe	O
places	O
,	O
they	O
can	O
be	O
made	O
to	O
point	O
to	O
unsafe	O
places	O
by	O
using	O
invalid	O
pointer	O
arithmetic	O
;	O
the	O
objects	O
they	O
point	O
to	O
may	O
continue	O
to	O
be	O
used	O
after	O
deallocation	B-General_Concept
(	O
dangling	B-Error_Name
pointers	I-Error_Name
)	O
;	O
they	O
may	O
be	O
used	O
without	O
having	O
been	O
initialized	O
(	O
wild	B-Error_Name
pointers	I-Error_Name
)	O
;	O
or	O
they	O
may	O
be	O
directly	O
assigned	O
an	O
unsafe	O
value	O
using	O
a	O
cast	O
,	O
union	O
,	O
or	O
through	O
another	O
corrupt	O
pointer	O
.	O
</s>
<s>
In	O
general	O
,	O
C	B-Language
is	O
permissive	O
in	O
allowing	O
manipulation	O
of	O
and	O
conversion	O
between	O
pointer	O
types	O
,	O
although	O
compilers	B-Language
typically	O
provide	O
options	O
for	B-Language
various	O
levels	O
of	O
checking	O
.	O
</s>
<s>
Array	O
types	O
in	O
C	B-Language
are	O
traditionally	O
of	O
a	O
fixed	O
,	O
static	B-Language
size	O
specified	O
at	O
compile	B-Language
time	O
.	O
</s>
<s>
The	O
more	O
recent	O
C99	B-Language
standard	I-Language
also	O
allows	O
a	O
form	O
of	O
variable-length	B-Data_Structure
arrays	I-Data_Structure
.	O
</s>
<s>
However	O
,	O
it	O
is	O
also	O
possible	O
to	O
allocate	O
a	O
block	O
of	O
memory	B-General_Concept
(	O
of	O
arbitrary	O
size	O
)	O
at	O
run-time	B-Library
,	O
using	O
the	O
standard	B-Language
library	I-Language
's	O
malloc	B-Language
function	O
,	O
and	O
treat	O
it	O
as	O
an	O
array	O
.	O
</s>
<s>
Since	O
arrays	O
are	O
always	O
accessed	O
(	O
in	O
effect	O
)	O
via	O
pointers	O
,	O
array	O
accesses	O
are	O
typically	O
not	O
checked	O
against	O
the	O
underlying	O
array	O
size	O
,	O
although	O
some	O
compilers	B-Language
may	O
provide	O
bounds	B-Data_Structure
checking	I-Data_Structure
as	O
an	O
option	O
.	O
</s>
<s>
Array	O
bounds	O
violations	O
are	O
therefore	O
possible	O
and	O
can	O
lead	O
to	O
various	O
repercussions	O
,	O
including	O
illegal	O
memory	B-General_Concept
accesses	O
,	O
corruption	O
of	O
data	O
,	O
buffer	B-General_Concept
overruns	I-General_Concept
,	O
and	O
run-time	B-Library
exceptions	O
.	O
</s>
<s>
C	B-Language
does	O
not	O
have	O
a	O
special	O
provision	O
for	B-Language
declaring	O
multi-dimensional	O
arrays	O
,	O
but	O
rather	O
relies	O
on	O
recursion	O
within	O
the	O
type	O
system	O
to	O
declare	O
arrays	O
of	O
arrays	O
,	O
which	O
effectively	O
accomplishes	O
the	O
same	O
thing	O
.	O
</s>
<s>
The	O
index	O
values	O
of	O
the	O
resulting	O
"	O
multi-dimensional	O
array	O
"	O
can	O
be	O
thought	O
of	O
as	O
increasing	O
in	O
row-major	B-Data_Structure
order	I-Data_Structure
.	O
</s>
<s>
Multi-dimensional	O
arrays	O
are	O
commonly	O
used	O
in	O
numerical	O
algorithms	O
(	O
mainly	O
from	O
applied	O
linear	B-Language
algebra	I-Language
)	O
to	O
store	O
matrices	O
.	O
</s>
<s>
The	O
structure	O
of	O
the	O
C	B-Language
array	O
is	O
well	O
suited	O
to	O
this	O
particular	O
task	O
.	O
</s>
<s>
However	O
,	O
in	O
early	O
versions	O
of	O
C	B-Language
the	O
bounds	O
of	O
the	O
array	O
must	O
be	O
known	O
fixed	O
values	O
or	O
else	B-Language
explicitly	O
passed	O
to	O
any	O
subroutine	O
that	O
requires	O
them	O
,	O
and	O
dynamically	O
sized	O
arrays	O
of	O
arrays	O
cannot	O
be	O
accessed	O
using	O
double	O
indexing	O
.	O
</s>
<s>
(	O
A	O
workaround	O
for	B-Language
this	O
was	O
to	O
allocate	O
the	O
array	O
with	O
an	O
additional	O
"	O
row	O
vector	O
"	O
of	O
pointers	O
to	O
the	O
columns	O
.	O
)	O
</s>
<s>
C99	B-Language
introduced	O
"	O
variable-length	B-Data_Structure
arrays	I-Data_Structure
"	O
which	O
address	O
this	O
issue	O
.	O
</s>
<s>
The	O
following	O
example	O
using	O
modern	O
C	B-Language
(	O
C99	B-Language
or	O
later	O
)	O
shows	O
allocation	O
of	O
a	O
two-dimensional	O
array	O
on	O
the	O
heap	B-General_Concept
and	O
the	O
use	O
of	O
multi-dimensional	O
array	O
indexing	O
for	B-Language
accesses	O
(	O
which	O
can	O
use	O
bounds-checking	O
on	O
many	O
C	B-Language
compilers	B-Language
)	O
:	O
</s>
<s>
And	O
here	O
is	O
a	O
similar	O
implementation	O
using	O
C99	B-Language
's	O
Auto	O
VLA	O
feature	O
:	O
</s>
<s>
The	O
subscript	O
notation	O
x[i]	O
(	O
where	O
x	O
designates	O
a	O
pointer	O
)	O
is	O
syntactic	O
sugar	O
for	B-Language
*( 	O
x+i	O
)	O
.	O
</s>
<s>
Taking	O
advantage	O
of	O
the	O
compiler	B-Language
's	O
knowledge	O
of	O
the	O
pointer	O
type	O
,	O
the	O
address	O
that	O
x	O
+	O
i	O
points	O
to	O
is	O
not	O
the	O
base	O
address	O
(	O
pointed	O
to	O
by	O
x	O
)	O
incremented	O
by	O
i	O
bytes	B-Application
,	O
but	O
rather	O
is	O
defined	O
to	O
be	O
the	O
base	O
address	O
incremented	O
by	O
i	O
multiplied	O
by	O
the	O
size	O
of	O
an	O
element	O
that	O
x	O
points	O
to	O
.	O
</s>
<s>
Furthermore	O
,	O
in	O
most	O
expression	O
contexts	O
(	O
a	O
notable	O
exception	O
is	O
as	O
operand	O
of	O
sizeof	B-Language
)	O
,	O
an	O
expression	O
of	O
array	O
type	O
is	O
automatically	O
converted	O
to	O
a	O
pointer	O
to	O
the	O
array	O
's	O
first	O
element	O
.	O
</s>
<s>
Therefore	O
,	O
although	O
function	O
calls	O
in	O
C	B-Language
use	O
pass-by-value	O
semantics	O
,	O
arrays	O
are	O
in	O
effect	O
passed	O
by	O
reference	O
.	O
</s>
<s>
The	O
total	O
size	O
of	O
an	O
array	O
x	O
can	O
be	O
determined	O
by	O
applying	O
sizeof	B-Language
to	O
an	O
expression	O
of	O
array	O
type	O
.	O
</s>
<s>
The	O
size	O
of	O
an	O
element	O
can	O
be	O
determined	O
by	O
applying	O
the	O
operator	O
sizeof	B-Language
to	O
any	O
dereferenced	O
element	O
of	O
an	O
array	O
A	O
,	O
as	O
in	O
n	O
=	O
sizeof	B-Language
A[0]	O
.	O
</s>
<s>
Thus	O
,	O
the	O
number	O
of	O
elements	O
in	O
a	O
declared	O
array	O
A	O
can	O
be	O
determined	O
as	O
sizeof	B-Language
A	O
/	O
sizeof	B-Language
A[0]	O
.	O
</s>
<s>
Note	O
,	O
that	O
if	B-Language
only	O
a	O
pointer	O
to	O
the	O
first	O
element	O
is	O
available	O
as	O
it	O
is	O
often	O
the	O
case	O
in	O
C	B-Language
code	O
because	O
of	O
the	O
automatic	O
conversion	O
described	O
above	O
,	O
the	O
information	O
about	O
the	O
full	O
type	O
of	O
the	O
array	O
and	O
its	O
length	O
are	O
lost	O
.	O
</s>
<s>
One	O
of	O
the	O
most	O
important	O
functions	O
of	O
a	O
programming	O
language	O
is	O
to	O
provide	O
facilities	O
for	B-Language
managing	O
memory	B-General_Concept
and	O
the	O
objects	O
that	O
are	O
stored	O
in	O
memory	B-General_Concept
.	O
</s>
<s>
C	B-Language
provides	O
three	O
principal	O
ways	O
to	O
allocate	O
memory	B-General_Concept
for	B-Language
objects	O
:	O
</s>
<s>
Static	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
:	O
space	O
for	B-Language
the	O
object	O
is	O
provided	O
in	O
the	O
binary	O
at	O
compile-time	O
;	O
these	O
objects	O
have	O
an	O
extent	O
(	O
or	O
lifetime	O
)	O
as	O
long	O
as	O
the	O
binary	O
which	O
contains	O
them	O
is	O
loaded	O
into	O
memory	B-General_Concept
.	O
</s>
<s>
Automatic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
:	O
temporary	O
objects	O
can	O
be	O
stored	O
on	O
the	O
stack	B-General_Concept
,	O
and	O
this	O
space	O
is	O
automatically	O
freed	O
and	O
reusable	O
after	O
the	O
block	O
in	O
which	O
they	O
are	O
declared	O
is	O
exited	O
.	O
</s>
<s>
For	B-Language
example	O
,	O
static	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
has	O
little	O
allocation	O
overhead	O
,	O
automatic	O
allocation	O
may	O
involve	O
slightly	O
more	O
overhead	O
,	O
and	O
dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
can	O
potentially	O
have	O
a	O
great	O
deal	O
of	O
overhead	O
for	B-Language
both	O
allocation	O
and	O
deallocation	B-General_Concept
.	O
</s>
<s>
The	O
persistent	O
nature	O
of	O
static	B-Language
objects	O
is	O
useful	O
for	B-Language
maintaining	O
state	O
information	O
across	O
function	O
calls	O
,	O
automatic	O
allocation	O
is	O
easy	O
to	O
use	O
but	O
stack	B-General_Concept
space	O
is	O
typically	O
much	O
more	O
limited	O
and	O
transient	O
than	O
either	O
static	B-Language
memory	B-General_Concept
or	O
heap	B-General_Concept
space	I-General_Concept
,	O
and	O
dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
allows	O
convenient	O
allocation	O
of	O
objects	O
whose	O
size	O
is	O
known	O
only	O
at	O
run-time	B-Library
.	O
</s>
<s>
Most	O
C	B-Language
programs	I-Language
make	O
extensive	O
use	O
of	O
all	O
three	O
.	O
</s>
<s>
Where	O
possible	O
,	O
automatic	O
or	O
static	B-Language
allocation	O
is	O
usually	O
simplest	O
because	O
the	O
storage	B-General_Concept
is	O
managed	O
by	O
the	O
compiler	B-Language
,	O
freeing	O
the	O
programmer	O
of	O
the	O
potentially	O
error-prone	O
chore	O
of	O
manually	O
allocating	O
and	O
releasing	O
storage	B-General_Concept
.	O
</s>
<s>
However	O
,	O
many	O
data	O
structures	O
can	O
change	O
in	O
size	O
at	B-Library
runtime	I-Library
,	O
and	O
since	O
static	B-Language
allocations	O
(	O
and	O
automatic	O
allocations	O
before	O
C99	B-Language
)	O
must	O
have	O
a	O
fixed	O
size	O
at	O
compile-time	O
,	O
there	O
are	O
many	O
situations	O
in	O
which	O
dynamic	B-Application
allocation	I-Application
is	O
necessary	O
.	O
</s>
<s>
Prior	O
to	O
the	O
C99	B-Language
standard	I-Language
,	O
variable-sized	O
arrays	O
were	O
a	O
common	O
example	O
of	O
this	O
.	O
</s>
<s>
(	O
See	O
the	O
article	O
on	O
malloc	B-Language
for	B-Language
an	O
example	O
of	O
dynamically	O
allocated	B-Application
arrays	O
.	O
)	O
</s>
<s>
Unlike	O
automatic	O
allocation	O
,	O
which	O
can	O
fail	O
at	O
run	B-Library
time	I-Library
with	O
uncontrolled	O
consequences	O
,	O
the	O
dynamic	B-Application
allocation	I-Application
functions	O
return	O
an	O
indication	O
(	O
in	O
the	O
form	O
of	O
a	O
null	O
pointer	O
value	O
)	O
when	O
the	O
required	O
storage	B-General_Concept
cannot	O
be	O
allocated	B-Application
.	O
</s>
<s>
(	O
Static	B-Language
allocation	O
that	O
is	O
too	O
large	O
is	O
usually	O
detected	O
by	O
the	O
linker	B-Application
or	O
loader	B-Operating_System
,	O
before	O
the	O
program	O
can	O
even	O
begin	O
execution	O
.	O
)	O
</s>
<s>
Unless	O
otherwise	O
specified	O
,	O
static	B-Language
objects	O
contain	O
zero	O
or	O
null	O
pointer	O
values	O
upon	O
program	O
startup	O
.	O
</s>
<s>
Automatically	O
and	O
dynamically	O
allocated	B-Application
objects	O
are	O
initialized	O
only	O
if	B-Language
an	O
initial	O
value	O
is	O
explicitly	O
specified	O
;	O
otherwise	O
they	O
initially	O
have	O
indeterminate	O
values	O
(	O
typically	O
,	O
whatever	O
bit	O
pattern	O
happens	O
to	O
be	O
present	O
in	O
the	O
storage	B-General_Concept
,	O
which	O
might	O
not	O
even	O
represent	O
a	O
valid	O
value	O
for	B-Language
that	O
type	O
)	O
.	O
</s>
<s>
If	B-Language
the	O
program	O
attempts	O
to	O
access	O
an	O
uninitialized	O
value	O
,	O
the	O
results	O
are	O
undefined	O
.	O
</s>
<s>
Many	O
modern	O
compilers	B-Language
try	O
to	O
detect	O
and	O
warn	O
about	O
this	O
problem	O
,	O
but	O
both	O
false	O
positives	O
and	O
false	O
negatives	O
can	O
occur	O
.	O
</s>
<s>
Heap	B-General_Concept
memory	B-General_Concept
allocation	I-General_Concept
has	O
to	O
be	O
synchronized	O
with	O
its	O
actual	O
usage	O
in	O
any	O
program	O
to	O
be	O
reused	O
as	O
much	O
as	O
possible	O
.	O
</s>
<s>
For	B-Language
example	O
,	O
if	B-Language
the	O
only	O
pointer	O
to	O
a	O
heap	B-General_Concept
memory	B-General_Concept
allocation	I-General_Concept
goes	O
out	O
of	O
scope	O
or	O
has	O
its	O
value	O
overwritten	O
before	O
it	O
is	O
deallocated	O
explicitly	O
,	O
then	O
that	O
memory	B-General_Concept
cannot	O
be	O
recovered	O
for	B-Language
later	O
reuse	O
and	O
is	O
essentially	O
lost	O
to	O
the	O
program	O
,	O
a	O
phenomenon	O
known	O
as	O
a	O
memory	B-Error_Name
leak	I-Error_Name
.	O
</s>
<s>
Conversely	O
,	O
it	O
is	O
possible	O
for	B-Language
memory	B-General_Concept
to	O
be	O
freed	O
,	O
but	O
is	O
referenced	O
subsequently	O
,	O
leading	O
to	O
unpredictable	O
results	O
.	O
</s>
<s>
Such	O
issues	O
are	O
ameliorated	O
in	O
languages	O
with	O
automatic	B-General_Concept
garbage	I-General_Concept
collection	I-General_Concept
.	O
</s>
<s>
The	O
C	B-Language
programming	I-Language
language	I-Language
uses	O
libraries	B-Library
as	O
its	O
primary	O
method	O
of	O
extension	O
.	O
</s>
<s>
In	O
C	B-Language
,	O
a	O
library	B-Library
is	O
a	O
set	O
of	O
functions	O
contained	O
within	O
a	O
single	O
"	O
archive	O
"	O
file	O
.	O
</s>
<s>
Each	O
library	B-Library
typically	O
has	O
a	O
header	B-Language
file	I-Language
,	O
which	O
contains	O
the	O
prototypes	O
of	O
the	O
functions	O
contained	O
within	O
the	O
library	B-Library
that	O
may	O
be	O
used	O
by	O
a	O
program	O
,	O
and	O
declarations	O
of	O
special	O
data	O
types	O
and	O
macro	O
symbols	O
used	O
with	O
these	O
functions	O
.	O
</s>
<s>
In	O
order	O
for	B-Language
a	O
program	O
to	O
use	O
a	O
library	B-Library
,	O
it	O
must	O
include	O
the	O
library	B-Library
's	O
header	B-Language
file	I-Language
,	O
and	O
the	O
library	B-Library
must	O
be	O
linked	B-Application
with	O
the	O
program	O
,	O
which	O
in	O
many	O
cases	O
requires	O
compiler	B-Language
flags	O
(	O
e.g.	O
,	O
-lm	O
,	O
shorthand	O
for	B-Language
"	O
link	O
the	O
math	O
library	B-Library
"	O
)	O
.	O
</s>
<s>
The	O
most	O
common	O
C	B-Language
library	I-Language
is	O
the	B-Language
C	I-Language
standard	I-Language
library	I-Language
,	O
which	O
is	O
specified	O
by	O
the	O
ISO	O
and	O
ANSI	O
C	B-Language
standards	O
and	O
comes	O
with	O
every	O
C	B-Language
implementation	O
(	O
implementations	O
which	O
target	O
limited	O
environments	O
such	O
as	O
embedded	B-Architecture
systems	I-Architecture
may	O
provide	O
only	O
a	O
subset	O
of	O
the	O
standard	B-Language
library	I-Language
)	O
.	O
</s>
<s>
This	O
library	B-Library
supports	O
stream	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
,	O
memory	B-General_Concept
allocation	I-General_Concept
,	O
mathematics	O
,	O
character	O
strings	O
,	O
and	O
time	O
values	O
.	O
</s>
<s>
Several	O
separate	O
standard	O
headers	O
(	O
for	B-Language
example	O
,	O
stdio.h	B-Language
)	O
specify	O
the	O
interfaces	O
for	B-Language
these	O
and	O
other	O
standard	B-Language
library	I-Language
facilities	O
.	O
</s>
<s>
Another	O
common	O
set	O
of	O
C	B-Language
library	I-Language
functions	O
are	O
those	O
used	O
by	O
applications	O
specifically	O
targeted	O
for	B-Language
Unix	B-Application
and	O
Unix-like	B-Operating_System
systems	I-Operating_System
,	O
especially	O
functions	O
which	O
provide	O
an	O
interface	O
to	O
the	O
kernel	B-Operating_System
.	O
</s>
<s>
These	O
functions	O
are	O
detailed	O
in	O
various	O
standards	O
such	O
as	O
POSIX	O
and	O
the	O
Single	O
UNIX	B-Application
Specification	O
.	O
</s>
<s>
Since	O
many	O
programs	O
have	O
been	O
written	O
in	O
C	B-Language
,	O
there	O
are	O
a	O
wide	O
variety	O
of	O
other	O
libraries	B-Library
available	O
.	O
</s>
<s>
Libraries	B-Library
are	O
often	O
written	O
in	O
C	B-Language
because	O
C	B-Language
compilers	B-Language
generate	O
efficient	O
object	B-Language
code	I-Language
;	O
programmers	O
then	O
create	O
interfaces	O
to	O
the	O
library	B-Library
so	O
that	O
the	O
routines	O
can	O
be	O
used	O
from	O
higher-level	O
languages	O
like	O
Java	B-Language
,	O
Perl	B-Language
,	O
and	O
Python	B-Language
.	O
</s>
<s>
File	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
(	O
I/O	B-General_Concept
)	O
is	O
not	O
part	O
of	O
the	O
C	B-Language
language	I-Language
itself	O
but	O
instead	O
is	O
handled	O
by	O
libraries	B-Library
(	O
such	O
as	O
the	B-Language
C	I-Language
standard	I-Language
library	I-Language
)	O
and	O
their	O
associated	O
header	B-Language
files	I-Language
(	O
e.g.	O
</s>
<s>
stdio.h	B-Language
)	O
.	O
</s>
<s>
File	O
handling	O
is	O
generally	O
implemented	B-Language
through	O
high-level	O
I/O	B-General_Concept
which	O
works	O
through	O
streams	B-Architecture
.	O
</s>
<s>
The	O
high-level	O
I/O	B-General_Concept
is	O
done	O
through	O
the	O
association	O
of	O
a	O
stream	O
to	O
a	O
file	O
.	O
</s>
<s>
In	O
the	B-Language
C	I-Language
standard	I-Language
library	I-Language
,	O
a	O
buffer	B-General_Concept
(	O
a	O
memory	B-General_Concept
area	O
or	O
queue	O
)	O
is	O
temporarily	O
used	O
to	O
store	O
data	O
before	O
it	O
is	O
sent	O
to	O
the	O
final	O
destination	O
.	O
</s>
<s>
This	O
reduces	O
the	O
time	O
spent	O
waiting	O
for	B-Language
slower	O
devices	O
,	O
for	B-Language
example	O
a	O
hard	B-Device
drive	I-Device
or	O
solid	B-Device
state	I-Device
drive	I-Device
.	O
</s>
<s>
Low-level	B-Language
I/O	B-General_Concept
functions	O
are	O
not	O
part	O
of	O
the	O
standard	B-Language
C	I-Language
library	I-Language
but	O
are	O
generally	O
part	O
of	O
"	O
bare	O
metal	O
"	O
programming	O
(	O
programming	O
that	O
's	O
independent	O
of	O
any	O
operating	B-General_Concept
system	I-General_Concept
such	O
as	O
most	O
embedded	B-Application
programming	I-Application
)	O
.	O
</s>
<s>
With	O
few	O
exceptions	O
,	O
implementations	O
include	O
low-level	B-Language
I/O	B-General_Concept
.	O
</s>
<s>
A	O
number	O
of	O
tools	O
have	O
been	O
developed	O
to	O
help	O
C	B-Language
programmers	O
find	O
and	O
fix	O
statements	O
with	O
undefined	O
behavior	O
or	O
possibly	O
erroneous	O
expressions	O
,	O
with	O
greater	O
rigor	O
than	O
that	O
provided	O
by	O
the	O
compiler	B-Language
.	O
</s>
<s>
The	O
tool	O
lint	B-Device
was	O
the	O
first	O
such	O
,	O
leading	O
to	O
many	O
others	O
.	O
</s>
<s>
Automated	O
source	O
code	O
checking	O
and	O
auditing	O
are	O
beneficial	O
in	O
any	O
language	O
,	O
and	O
for	B-Language
C	B-Language
many	O
such	O
tools	O
exist	O
,	O
such	O
as	O
Lint	B-Device
.	O
</s>
<s>
A	O
common	O
practice	O
is	O
to	O
use	O
Lint	B-Device
to	O
detect	O
questionable	O
code	O
when	O
a	O
program	O
is	O
first	O
written	O
.	O
</s>
<s>
Once	O
a	O
program	O
passes	O
Lint	B-Device
,	O
it	O
is	O
then	O
compiled	B-Language
using	O
the	O
C	B-Language
compiler	B-Language
.	O
</s>
<s>
Also	O
,	O
many	O
compilers	B-Language
can	O
optionally	O
warn	O
about	O
syntactically	O
valid	O
constructs	O
that	O
are	O
likely	O
to	O
actually	O
be	O
errors	O
.	O
</s>
<s>
MISRA	B-Language
C	I-Language
is	O
a	O
proprietary	O
set	O
of	O
guidelines	O
to	O
avoid	O
such	O
questionable	O
code	O
,	O
developed	O
for	B-Language
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
There	O
are	O
also	O
compilers	B-Language
,	O
libraries	B-Library
,	O
and	O
operating	B-General_Concept
system	I-General_Concept
level	O
mechanisms	O
for	B-Language
performing	O
actions	O
that	O
are	O
not	O
a	O
standard	O
part	O
of	O
C	B-Language
,	O
such	O
as	O
bounds	B-Data_Structure
checking	I-Data_Structure
for	B-Language
arrays	O
,	O
detection	O
of	O
buffer	B-General_Concept
overflow	I-General_Concept
,	O
serialization	B-Application
,	O
dynamic	B-General_Concept
memory	I-General_Concept
tracking	O
,	O
and	O
automatic	B-General_Concept
garbage	I-General_Concept
collection	I-General_Concept
.	O
</s>
<s>
Tools	O
such	O
as	O
Purify	B-General_Concept
or	O
Valgrind	B-Application
and	O
linking	B-Application
with	O
libraries	B-Library
containing	O
special	O
versions	O
of	O
the	O
memory	B-Language
allocation	I-Language
functions	I-Language
can	O
help	O
uncover	O
runtime	B-Library
errors	I-Library
in	O
memory	B-General_Concept
usage	I-General_Concept
.	O
</s>
<s>
C	B-Language
is	O
widely	O
used	O
for	B-Language
systems	B-Application
programming	I-Application
in	O
implementing	O
operating	B-General_Concept
systems	I-General_Concept
and	O
embedded	B-Architecture
system	I-Architecture
applications	O
.	O
</s>
<s>
This	O
is	O
for	B-Language
several	O
reasons	O
:	O
</s>
<s>
The	O
code	O
generated	O
after	O
compilation	B-Language
does	O
n't	O
demand	O
many	O
system	B-Device
features	I-Device
,	O
and	O
can	O
be	O
invoked	O
from	O
some	O
boot	O
code	O
in	O
a	O
straightforward	O
manner	O
–	O
it	O
's	O
simple	O
to	O
execute	O
.	O
</s>
<s>
The	O
C	B-Language
language	I-Language
statements	O
and	O
expressions	O
typically	O
map	O
well	O
on	O
to	O
sequences	O
of	O
instructions	O
for	B-Language
the	O
target	O
processor	O
,	O
and	O
consequently	O
there	O
is	O
a	O
low	O
run-time	B-Library
demand	O
on	O
system	O
resources	O
–	O
it	O
's	O
fast	O
to	O
execute	O
.	O
</s>
<s>
With	O
its	O
rich	O
set	O
of	O
operators	O
,	O
the	O
C	B-Language
language	I-Language
can	O
utilise	O
many	O
of	O
the	O
features	O
of	O
target	O
CPUs	O
.	O
</s>
<s>
Where	O
a	O
particular	O
CPU	O
has	O
more	O
esoteric	O
instructions	O
,	O
a	O
language	O
variant	O
can	O
be	O
constructed	O
with	O
perhaps	O
intrinsic	B-Application
functions	I-Application
to	O
exploit	O
those	O
instructions	O
–	O
it	O
can	O
use	O
practically	O
all	O
the	O
target	O
CPU	O
's	O
features	O
.	O
</s>
<s>
The	O
language	O
supports	O
a	O
rich	O
set	O
of	O
operators	O
,	O
including	O
bit	O
manipulation	O
,	O
for	B-Language
integer	O
arithmetic	O
and	O
logic	O
,	O
and	O
perhaps	O
different	O
sizes	O
of	O
floating	B-Algorithm
point	I-Algorithm
numbers	I-Algorithm
–	O
it	O
can	O
process	O
appropriately-structured	O
data	O
effectively	O
.	O
</s>
<s>
C	B-Language
is	O
a	O
fairly	O
small	O
language	O
,	O
with	O
only	O
a	O
handful	O
of	O
statements	O
,	O
and	O
without	O
too	O
many	O
features	O
that	O
generate	O
extensive	O
target	O
code	O
–	O
it	O
is	O
comprehensible	O
.	O
</s>
<s>
C	B-Language
has	O
direct	O
control	O
over	O
memory	B-General_Concept
allocation	I-General_Concept
and	O
deallocation	B-General_Concept
,	O
which	O
gives	O
reasonable	O
efficiency	O
and	O
predictable	O
timing	O
to	O
memory-handling	O
operations	O
,	O
without	O
any	O
concerns	O
for	B-Language
sporadic	O
stop-the-world	O
garbage	B-General_Concept
collection	I-General_Concept
events	O
–	O
it	O
has	O
predictable	O
performance	O
.	O
</s>
<s>
Platform	B-Device
hardware	O
can	O
be	O
accessed	O
with	O
pointers	O
and	O
type	B-Language
punning	I-Language
,	O
so	O
system-specific	O
features	O
(	O
e.g.	O
</s>
<s>
Control/Status	B-General_Concept
Registers	I-General_Concept
,	O
I/O	B-Architecture
registers	I-Architecture
)	O
can	O
be	O
configured	O
and	O
used	O
with	O
code	O
written	O
in	O
C	B-Language
–	O
it	O
interacts	O
well	O
with	O
the	O
platform	B-Device
it	O
's	O
running	O
on	O
.	O
</s>
<s>
Depending	O
on	O
the	O
linker	B-Application
and	O
environment	O
,	O
C	B-Language
code	O
can	O
also	O
call	O
libraries	B-Library
written	O
in	O
assembly	B-Language
language	I-Language
,	O
and	O
may	O
be	O
called	O
from	O
assembly	B-Language
language	I-Language
–	O
it	O
interoperates	O
well	O
with	O
other	O
lower-level	O
code	O
.	O
</s>
<s>
C	B-Language
and	O
its	O
calling	O
conventions	O
and	O
linker	B-Application
structures	O
are	O
commonly	O
used	O
in	O
conjunction	O
with	O
other	O
high-level	O
languages	O
,	O
with	O
calls	O
both	O
to	O
C	B-Language
and	O
from	O
C	B-Language
supported	O
–	O
it	O
interoperates	O
well	O
with	O
other	O
high-level	O
code	O
.	O
</s>
<s>
C	B-Language
has	O
a	O
very	O
mature	O
and	O
broad	O
ecosystem	O
,	O
including	O
libraries	B-Library
,	O
frameworks	O
,	O
open	O
source	O
compilers	B-Language
,	O
debuggers	O
and	O
utilities	O
,	O
and	O
is	O
the	O
de	O
facto	O
standard	O
.	O
</s>
<s>
It	O
's	O
likely	O
the	O
drivers	O
already	O
exist	O
in	O
C	B-Language
,	O
or	O
that	O
there	O
is	O
a	O
similar	O
CPU	O
architecture	O
as	O
a	O
back-end	O
of	O
a	O
C	B-Language
compiler	B-Language
,	O
so	O
there	O
is	O
reduced	O
incentive	O
to	O
choose	O
another	O
language	O
.	O
</s>
<s>
Historically	O
,	O
C	B-Language
was	O
sometimes	O
used	O
for	B-Language
web	O
development	O
using	O
the	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
(	O
CGI	O
)	O
as	O
a	O
"	O
gateway	O
"	O
for	B-Language
information	O
between	O
the	O
web	O
application	O
,	O
the	O
server	O
,	O
and	O
the	O
browser	O
.	O
</s>
<s>
C	B-Language
may	O
have	O
been	O
chosen	O
over	O
interpreted	B-Application
languages	I-Application
because	O
of	O
its	O
speed	O
,	O
stability	O
,	O
and	O
near-universal	O
availability	O
.	O
</s>
<s>
It	O
is	O
no	O
longer	O
common	O
practice	O
for	B-Language
web	O
development	O
to	O
be	O
done	O
in	O
C	B-Language
,	O
and	O
many	O
other	O
web	B-Application
development	I-Application
tools	I-Application
exist	O
.	O
</s>
<s>
A	O
consequence	O
of	O
C	B-Language
's	O
wide	O
availability	O
and	O
efficiency	O
is	O
that	O
compilers	B-Language
,	O
libraries	B-Library
and	O
interpreters	B-Application
of	O
other	O
programming	O
languages	O
are	O
often	O
implemented	B-Language
in	O
C	B-Language
.	O
For	B-Language
example	O
,	O
the	O
reference	O
implementations	O
of	O
Python	B-Language
,	O
Perl	B-Language
,	O
Ruby	B-Language
,	O
and	O
PHP	B-Application
are	O
written	O
in	O
C	B-Language
.	O
</s>
<s>
C	B-Language
enables	O
programmers	O
to	O
create	O
efficient	O
implementations	O
of	O
algorithms	O
and	O
data	O
structures	O
,	O
because	O
the	O
layer	O
of	O
abstraction	O
from	O
hardware	O
is	O
thin	O
,	O
and	O
its	O
overhead	O
is	O
low	O
,	O
an	O
important	O
criterion	O
for	B-Language
computationally	O
intensive	O
programs	O
.	O
</s>
<s>
For	B-Language
example	O
,	O
the	O
GNU	B-Application
Multiple	I-Application
Precision	I-Application
Arithmetic	I-Application
Library	I-Application
,	O
the	O
GNU	B-Application
Scientific	I-Application
Library	I-Application
,	O
Mathematica	B-Language
,	O
and	O
MATLAB	B-Language
are	O
completely	O
or	O
partially	O
written	O
in	O
C	B-Language
.	O
Many	O
languages	O
support	O
calling	O
library	B-Library
functions	I-Library
in	O
C	B-Language
,	O
for	B-Language
example	O
,	O
the	O
Python-based	O
framework	O
NumPy	B-Application
uses	O
C	B-Language
for	B-Language
the	O
high-performance	O
and	O
hardware-interacting	O
aspects	O
.	O
</s>
<s>
C	B-Language
is	O
sometimes	O
used	O
as	O
an	O
intermediate	O
language	O
by	O
implementations	O
of	O
other	O
languages	O
.	O
</s>
<s>
This	O
approach	O
may	O
be	O
used	O
for	B-Language
portability	B-Architecture
or	O
convenience	O
;	O
by	O
using	O
C	B-Language
as	O
an	O
intermediate	O
language	O
,	O
additional	O
machine-specific	O
code	O
generators	O
are	O
not	O
necessary	O
.	O
</s>
<s>
C	B-Language
has	O
some	O
features	O
,	O
such	O
as	O
line-number	O
preprocessor	B-General_Concept
directives	O
and	O
optional	O
superfluous	O
commas	O
at	O
the	O
end	O
of	O
initializer	O
lists	O
,	O
that	O
support	O
compilation	B-Language
of	O
generated	O
code	O
.	O
</s>
<s>
However	O
,	O
some	O
of	O
C	B-Language
's	O
shortcomings	O
have	O
prompted	O
the	O
development	O
of	O
other	O
C-based	B-Language
languages	I-Language
specifically	O
designed	O
for	B-Language
use	O
as	O
intermediate	B-Application
languages	I-Application
,	O
such	O
as	O
C--	B-Language
.	O
</s>
<s>
Also	O
,	O
contemporary	O
major	O
compilers	B-Language
GCC	B-Application
and	O
LLVM	B-Application
both	O
feature	O
an	O
intermediate	B-Application
representation	I-Application
that	O
is	O
not	O
C	B-Language
,	O
and	O
those	O
compilers	B-Language
support	O
front	O
ends	O
for	B-Language
many	O
languages	O
including	O
C	B-Language
.	O
</s>
<s>
C	B-Language
has	O
also	O
been	O
widely	O
used	O
to	O
implement	O
end-user	O
applications	O
.	O
</s>
<s>
While	O
C	B-Language
has	O
been	O
popular	O
,	O
influential	O
and	O
hugely	O
successful	O
,	O
it	O
has	O
drawbacks	O
,	O
including	O
:	O
</s>
<s>
The	O
standard	O
dynamic	B-General_Concept
memory	I-General_Concept
handling	O
with	O
malloc	B-Language
and	O
free	B-Language
is	O
error	O
prone	O
.	O
</s>
<s>
Bugs	O
include	O
:	O
Memory	B-Error_Name
leaks	I-Error_Name
when	O
memory	B-General_Concept
is	O
allocated	B-Application
but	O
not	O
freed	O
;	O
and	O
access	O
to	O
previously	O
freed	O
memory	B-General_Concept
.	O
</s>
<s>
The	O
use	O
of	O
pointers	O
and	O
the	O
direct	O
manipulation	O
of	O
memory	B-General_Concept
means	O
corruption	O
of	O
memory	B-General_Concept
is	O
possible	O
,	O
perhaps	O
due	O
to	O
programmer	O
error	O
,	O
or	O
insufficient	O
checking	O
of	O
bad	O
data	O
.	O
</s>
<s>
There	O
is	O
some	O
type	O
checking	O
,	O
but	O
it	O
does	O
not	O
apply	O
to	O
areas	O
like	O
variadic	B-Language
functions	I-Language
,	O
and	O
the	O
type	O
checking	O
can	O
be	O
trivially	O
or	O
inadvertently	O
circumvented	O
.	O
</s>
<s>
Since	O
the	O
code	O
generated	O
by	O
the	O
compiler	B-Language
contains	O
few	O
checks	O
itself	O
,	O
there	O
is	O
a	O
burden	O
on	O
the	O
programmer	O
to	O
consider	O
all	O
possible	O
outcomes	O
,	O
to	O
protect	O
against	O
buffer	B-General_Concept
overruns	I-General_Concept
,	O
array	B-Data_Structure
bounds	I-Data_Structure
checking	I-Data_Structure
,	O
stack	B-Error_Name
overflows	I-Error_Name
,	O
memory	B-General_Concept
exhaustion	O
,	O
and	O
consider	O
race	O
conditions	O
,	O
thread	O
isolation	O
,	O
etc	O
.	O
</s>
<s>
The	O
use	O
of	O
pointers	O
and	O
the	O
run-time	B-Library
manipulation	O
of	O
these	O
means	O
there	O
may	O
be	O
two	O
ways	O
to	O
access	O
the	O
same	O
data	O
(	O
aliasing	O
)	O
,	O
which	O
is	O
not	O
determinable	O
at	O
compile	B-Language
time	O
.	O
</s>
<s>
This	O
means	O
that	O
some	O
optimisations	O
that	O
may	O
be	O
available	O
to	O
other	O
languages	O
are	O
not	O
possible	O
in	O
C	B-Language
.	O
FORTRAN	B-Application
is	O
considered	O
faster	O
.	O
</s>
<s>
Some	O
of	O
the	O
standard	B-Language
library	I-Language
functions	O
,	O
e.g.	O
</s>
<s>
scanf	O
or	O
,	O
can	O
lead	O
to	O
buffer	B-General_Concept
overruns	I-General_Concept
.	O
</s>
<s>
There	O
is	O
limited	O
standardisation	O
in	O
support	O
for	B-Language
low-level	B-Language
variants	O
in	O
generated	O
code	O
,	O
for	B-Language
example	O
:	O
different	O
function	O
calling	O
conventions	O
and	O
ABI	B-Operating_System
;	O
different	O
structure	O
packing	O
conventions	O
;	O
different	O
byte	B-Application
ordering	O
within	O
larger	O
integers	O
(	O
including	O
endianness	O
)	O
.	O
</s>
<s>
In	O
many	O
language	O
implementations	O
,	O
some	O
of	O
these	O
options	O
may	O
be	O
handled	O
with	O
the	O
preprocessor	B-General_Concept
directive	O
#pragma	O
,	O
and	O
some	O
with	O
additional	O
keywords	O
e.g.	O
</s>
<s>
String	B-Language
handling	I-Language
using	O
the	O
standard	B-Language
library	I-Language
is	O
code-intensive	O
,	O
with	O
explicit	O
memory	B-General_Concept
management	I-General_Concept
required	O
.	O
</s>
<s>
The	O
language	O
does	O
not	O
directly	O
support	O
object	B-Language
orientation	I-Language
,	O
introspection	B-Application
,	O
run-time	B-Library
expression	O
evaluation	O
,	O
generics	O
,	O
etc	O
.	O
</s>
<s>
This	O
facility	O
for	B-Language
tricky	O
code	O
has	O
been	O
celebrated	O
with	O
competitions	O
such	O
as	O
the	O
International	O
Obfuscated	O
C	B-Language
Code	O
Contest	O
and	O
the	O
Underhanded	O
C	B-Language
Contest	O
.	O
</s>
<s>
C	B-Language
lacks	O
standard	O
support	O
for	B-Language
exception	B-General_Concept
handling	I-General_Concept
and	O
only	O
offers	O
return	B-Application
codes	I-Application
for	B-Language
error	O
checking	O
.	O
</s>
<s>
The	O
setjmp	B-Language
and	O
longjmp	B-Language
standard	B-Language
library	I-Language
functions	O
have	O
been	O
used	O
to	O
implement	O
a	O
try-catch	O
mechanism	O
via	O
macros	O
.	O
</s>
<s>
For	B-Language
some	O
purposes	O
,	O
restricted	O
styles	O
of	O
C	B-Language
have	O
been	O
adopted	O
,	O
e.g.	O
</s>
<s>
MISRA	B-Language
C	I-Language
or	O
CERT	B-Language
C	I-Language
,	O
in	O
an	O
attempt	O
to	O
reduce	O
the	O
opportunity	O
for	B-Language
bugs	O
.	O
</s>
<s>
Databases	O
such	O
as	O
CWE	B-Protocol
attempt	O
to	O
count	O
the	O
ways	O
C	B-Language
etc	O
.	O
</s>
<s>
has	O
vulnerabilities	O
,	O
along	O
with	O
recommendations	O
for	B-Language
mitigation	O
.	O
</s>
<s>
Contemporary	O
C	B-Language
compilers	B-Language
include	O
checks	O
which	O
may	O
generate	O
warnings	O
to	O
help	O
identify	O
many	O
potential	O
bugs	O
.	O
</s>
<s>
C	B-Language
has	O
both	O
directly	O
and	O
indirectly	O
influenced	O
many	O
later	O
languages	O
such	O
as	O
C++	B-Language
and	O
Java	B-Language
.	O
</s>
<s>
The	O
most	O
pervasive	O
influence	O
has	O
been	O
syntactical	O
;	O
all	O
of	O
the	O
languages	O
mentioned	O
combine	O
the	O
statement	O
and	O
(	O
more	O
or	O
less	O
recognizably	O
)	O
expression	O
syntax	O
of	O
C	B-Language
with	O
type	O
systems	O
,	O
data	O
models	O
or	O
large-scale	O
program	B-Language
structures	I-Language
that	O
differ	O
from	O
those	O
of	O
C	B-Language
,	O
sometimes	O
radically	O
.	O
</s>
<s>
Several	O
C	B-Language
or	O
near-C	O
interpreters	B-Application
exist	O
,	O
including	O
Ch	B-Language
and	O
CINT	B-Application
,	O
which	O
can	O
also	O
be	O
used	O
for	B-Language
scripting	O
.	O
</s>
<s>
When	O
object-oriented	B-Language
programming	I-Language
languages	I-Language
became	O
popular	O
,	O
C++	B-Language
and	O
Objective-C	B-Language
were	O
two	O
different	O
extensions	O
of	O
C	B-Language
that	O
provided	O
object-oriented	B-Language
capabilities	O
.	O
</s>
<s>
Both	O
languages	O
were	O
originally	O
implemented	B-Language
as	O
source-to-source	B-Language
compilers	I-Language
;	O
source	O
code	O
was	O
translated	O
into	O
C	B-Language
,	O
and	O
then	O
compiled	B-Language
with	O
a	O
C	B-Language
compiler	B-Language
.	O
</s>
<s>
The	O
C++	B-Language
programming	I-Language
language	I-Language
(	O
originally	O
named	O
"	O
C	B-Language
with	O
Classes	O
"	O
)	O
was	O
devised	O
by	O
Bjarne	O
Stroustrup	O
as	O
an	O
approach	O
to	O
providing	O
object-oriented	B-Language
functionality	O
with	O
a	O
C-like	B-Language
syntax	O
.	O
</s>
<s>
C++	B-Language
adds	O
greater	O
typing	O
strength	O
,	O
scoping	O
,	O
and	O
other	O
tools	O
useful	O
in	O
object-oriented	B-Language
programming	I-Language
,	O
and	O
permits	O
generic	B-Language
programming	I-Language
via	O
templates	O
.	O
</s>
<s>
Nearly	O
a	O
superset	O
of	O
C	B-Language
,	O
C++	B-Language
now	O
supports	O
most	O
of	O
C	B-Language
,	O
with	O
a	B-Language
few	I-Language
exceptions	I-Language
.	O
</s>
<s>
Objective-C	B-Language
was	O
originally	O
a	O
very	O
"	O
thin	O
"	O
layer	O
on	O
top	O
of	O
C	B-Language
,	O
and	O
remains	O
a	O
strict	O
superset	O
of	O
C	B-Language
that	O
permits	O
object-oriented	B-Language
programming	I-Language
using	O
a	O
hybrid	O
dynamic/static	O
typing	O
paradigm	O
.	O
</s>
<s>
Objective-C	B-Language
derives	O
its	O
syntax	O
from	O
both	O
C	B-Language
and	I-Language
Smalltalk	I-Language
:	O
syntax	O
that	O
involves	O
preprocessing	O
,	O
expressions	O
,	O
function	O
declarations	O
,	O
and	O
function	O
calls	O
is	O
inherited	O
from	O
C	B-Language
,	O
while	O
the	O
syntax	O
for	B-Language
object-oriented	B-Language
features	O
was	O
originally	O
taken	O
from	O
Smalltalk	B-Application
.	O
</s>
<s>
In	O
addition	O
to	O
C++	B-Language
and	O
Objective-C	B-Language
,	O
Ch	B-Language
,	O
Cilk	B-Language
,	O
and	O
Unified	B-Operating_System
Parallel	I-Operating_System
C	I-Operating_System
are	O
nearly	O
supersets	O
of	O
C	B-Language
.	O
</s>
