<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
the	O
stride	B-Data_Structure
of	I-Data_Structure
an	I-Data_Structure
array	I-Data_Structure
(	O
also	O
referred	O
to	O
as	O
increment	O
,	O
pitch	O
or	O
step	O
size	O
)	O
is	O
the	O
number	O
of	O
locations	O
in	O
memory	B-General_Concept
between	O
beginnings	O
of	O
successive	O
array	B-Data_Structure
elements	I-Data_Structure
,	O
measured	O
in	O
bytes	B-Application
or	O
in	O
units	O
of	O
the	O
size	O
of	O
the	O
array	B-Data_Structure
's	O
elements	O
.	O
</s>
<s>
An	O
array	B-Data_Structure
with	O
stride	O
of	O
exactly	O
the	O
same	O
size	O
as	O
the	O
size	O
of	O
each	O
of	O
its	O
elements	O
is	O
contiguous	O
in	O
memory	B-General_Concept
.	O
</s>
<s>
Unit	B-Data_Structure
stride	I-Data_Structure
arrays	I-Data_Structure
are	O
sometimes	O
more	O
efficient	O
than	O
non-unit	O
stride	O
arrays	O
,	O
but	O
non-unit	O
stride	O
arrays	O
can	O
be	O
more	O
efficient	O
for	O
2D	O
or	O
multi-dimensional	O
arrays	O
,	O
depending	O
on	O
the	O
effects	O
of	O
caching	B-General_Concept
and	O
the	O
access	O
patterns	O
used	O
.	O
</s>
<s>
This	O
can	O
be	O
attributed	O
to	O
the	O
principle	B-General_Concept
of	I-General_Concept
locality	I-General_Concept
,	O
specifically	O
spatial	O
locality	O
.	O
</s>
<s>
Arrays	O
may	O
have	O
a	O
stride	O
larger	O
than	O
their	O
elements	O
 '	O
width	O
in	O
bytes	B-Application
in	O
at	O
least	O
three	O
cases	O
:	O
</s>
<s>
Many	O
languages	O
(	O
including	O
C	B-Language
and	O
C++	B-Language
)	O
allow	O
structures	O
to	O
be	O
padded	B-Application
to	O
better	O
take	O
advantage	O
either	O
of	O
the	O
word	O
length	O
and/or	O
cache	O
line	O
size	O
of	O
the	O
machine	O
.	O
</s>
<s>
In	O
the	O
above	O
code	O
snippet	O
,	O
myArray	O
might	O
well	O
turn	O
out	O
to	O
have	O
a	O
stride	O
of	O
eight	O
bytes	B-Application
,	O
rather	O
than	O
five	O
(	O
4	O
bytes	B-Application
for	O
the	O
int	O
plus	O
one	O
for	O
the	O
char	O
)	O
,	O
if	O
the	O
C	B-Language
code	O
were	O
compiled	O
for	O
a	O
32-bit	O
architecture	O
,	O
and	O
the	O
compiler	O
had	O
optimized	O
(	O
as	O
is	O
usually	O
the	O
case	O
)	O
for	O
minimum	O
processing	O
time	O
rather	O
than	O
minimum	O
memory	B-General_Concept
usage	O
.	O
</s>
<s>
Some	O
languages	O
allow	O
arrays	O
of	O
structures	O
to	O
be	O
treated	O
as	O
overlapping	O
parallel	B-Data_Structure
arrays	I-Data_Structure
with	O
non-unit	O
stride	O
:	O
</s>
<s>
This	O
idiom	O
is	O
a	O
form	O
of	O
type	B-Language
punning	I-Language
.	O
</s>
<s>
Some	O
languages	O
like	O
PL/I	B-Language
allow	O
what	O
is	O
known	O
as	O
an	O
array	B-Data_Structure
cross-section	O
,	O
which	O
selects	O
certain	O
columns	O
or	O
rows	O
from	O
a	O
larger	O
array	B-Data_Structure
.	O
</s>
