<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
used	O
to	O
hold	O
information	O
about	O
a	O
data	O
object	O
,	O
especially	O
its	O
memory	B-General_Concept
layout	I-General_Concept
.	O
</s>
<s>
Dope	B-Data_Structure
vectors	I-Data_Structure
are	O
most	O
commonly	O
used	O
to	O
describe	O
arrays	B-Data_Structure
,	O
which	O
commonly	O
store	O
multiple	O
instances	O
of	O
a	O
particular	O
datatype	O
as	O
a	O
contiguous	O
block	O
of	O
memory	O
.	O
</s>
<s>
A	O
dope	B-Data_Structure
vector	I-Data_Structure
is	O
a	O
place	O
to	O
store	O
such	O
information	O
.	O
</s>
<s>
Dope	B-Data_Structure
vectors	I-Data_Structure
can	O
also	O
describe	O
structures	O
which	O
may	O
contain	O
arrays	B-Data_Structure
or	O
variable	O
elements	O
.	O
</s>
<s>
Navigating	O
an	O
array	B-Data_Structure
data	I-Data_Structure
structure	I-Data_Structure
using	O
an	O
index	O
is	O
called	O
dead	O
reckoning	O
.	O
</s>
<s>
This	O
arrangement	O
,	O
however	O
(	O
without	O
adding	O
dope	B-Data_Structure
vectors	I-Data_Structure
)	O
means	O
that	O
having	O
the	O
location	O
of	O
item	O
N	O
is	O
not	O
enough	O
to	O
discover	O
the	O
index	O
N	O
itself	O
;	O
or	O
the	O
stride	O
;	O
or	O
whether	O
there	O
are	O
elements	O
at	O
or	O
.	O
</s>
<s>
Without	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
,	O
even	O
knowing	O
the	O
address	O
of	O
the	O
entire	O
array	O
does	O
not	O
tell	O
you	O
how	O
big	O
it	O
is	O
.	O
</s>
<s>
Because	O
many	O
programming	O
languages	O
treat	O
character	O
strings	O
as	O
a	O
kind	O
of	O
array	O
,	O
this	O
leads	O
directly	O
to	O
the	O
infamous	O
buffer	B-General_Concept
overflow	I-General_Concept
problem	O
.	O
</s>
<s>
A	O
dope	B-Data_Structure
vector	I-Data_Structure
reduces	O
these	O
problems	O
by	O
storing	O
a	O
small	O
amount	O
of	O
metadata	O
along	O
with	O
an	O
array	O
(	O
or	O
other	O
object	O
)	O
.	O
</s>
<s>
With	O
dope	B-Data_Structure
vectors	I-Data_Structure
,	O
a	O
compiler	O
can	O
easily	O
(	O
and	O
optionally	O
)	O
insert	O
code	O
that	O
prevents	O
accidentally	O
writing	O
beyond	O
the	O
end	O
of	O
an	O
array	O
or	O
other	O
object	O
.	O
</s>
<s>
Alternatively	O
,	O
the	O
programmer	O
can	O
access	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
when	O
desired	O
,	O
for	O
safety	O
or	O
other	O
purposes	O
.	O
</s>
<s>
The	O
exact	O
set	O
of	O
metadata	O
included	O
in	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
varies	O
from	O
one	O
language	O
and/or	O
operating	O
system	O
to	O
another	O
,	O
but	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
for	O
an	O
array	O
might	O
contain	O
:	O
</s>
<s>
a	O
pointer	O
to	O
the	O
location	O
in	O
memory	O
where	O
the	O
array	B-Data_Structure
elements	I-Data_Structure
begin	O
(	O
this	O
is	O
normally	O
identical	O
to	O
the	O
location	O
of	O
the	O
zeroth	O
element	O
of	O
the	O
array	O
(	O
element	O
with	O
all	O
subscripts	O
0	O
)	O
.	O
</s>
<s>
the	O
type	O
of	O
each	O
array	B-Data_Structure
element	I-Data_Structure
(	O
integer	O
,	O
Boolean	O
,	O
a	O
particular	O
class	O
,	O
etc	O
.	O
</s>
<s>
the	O
rank	B-Data_Structure
of	I-Data_Structure
an	I-Data_Structure
array	I-Data_Structure
.	O
</s>
<s>
(	O
In	O
many	O
languages	O
the	O
starting	O
index	O
for	O
arrays	B-Data_Structure
is	O
fixed	O
at	O
zero	O
,	O
or	O
one	O
,	O
but	O
the	O
ending	O
index	O
is	O
set	O
when	O
the	O
array	O
is	O
(	O
re	O
-	O
)	O
allocated	O
.	O
)	O
</s>
<s>
for	O
arrays	B-Data_Structure
where	O
the	O
extent	O
in	O
use	O
at	O
a	O
given	O
time	O
may	O
change	O
,	O
the	O
maximum	O
and	O
current	O
extents	O
may	O
both	O
be	O
stored	O
.	O
</s>
<s>
the	O
stride	B-Data_Structure
of	I-Data_Structure
an	I-Data_Structure
array	I-Data_Structure
,	O
or	O
the	O
amount	O
of	O
memory	O
occupied	O
by	O
each	O
element	O
of	O
the	O
array	O
.	O
</s>
<s>
A	O
program	O
then	O
can	O
refer	O
to	O
the	O
array	O
(	O
or	O
other	O
dope-vector-using	O
object	O
)	O
by	O
referring	O
to	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
.	O
</s>
<s>
This	O
is	O
commonly	O
automatic	O
in	O
high-level	B-Language
languages	I-Language
.	O
</s>
<s>
Getting	O
to	O
an	O
element	O
of	O
the	O
array	O
costs	O
a	O
tiny	O
bit	O
more	O
(	O
commonly	O
one	O
instruction	O
,	O
which	O
fetches	O
the	O
pointer	O
to	O
the	O
actual	O
data	O
from	O
out	O
of	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
)	O
.	O
</s>
<s>
Without	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
,	O
determining	O
the	O
number	O
of	O
elements	O
in	O
the	O
array	O
is	O
impossible	O
.	O
</s>
<s>
Of	O
course	O
,	O
this	O
makes	O
length-checking	O
much	O
slower	O
than	O
looking	O
up	O
the	O
length	O
directly	O
in	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
.	O
</s>
<s>
Thus	O
,	O
without	O
dope	B-Data_Structure
vectors	I-Data_Structure
,	O
something	O
must	O
store	O
that	O
length	O
somewhere	O
else	O
.	O
</s>
<s>
This	O
extra	O
data	O
is	O
not	O
considered	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
,	O
but	O
achieves	O
some	O
of	O
the	O
same	O
goals	O
.	O
</s>
<s>
Without	O
dope	B-Data_Structure
vectors	I-Data_Structure
,	O
extra	O
information	O
must	O
also	O
be	O
kept	O
about	O
the	O
stride	O
(	O
or	O
width	O
)	O
of	O
array	B-Data_Structure
elements	I-Data_Structure
.	O
</s>
<s>
In	O
C	B-Language
,	O
this	O
information	O
is	O
handled	O
by	O
the	O
compiler	O
,	O
which	O
must	O
keep	O
track	O
of	O
a	O
datatype	O
distinction	O
between	O
"	O
pointer	O
to	O
an	O
array	O
of	O
20-byte-wide	O
elements	O
"	O
,	O
and	O
"	O
pointer	O
to	O
an	O
array	O
of	O
1000-byte-wide	O
elements	O
"	O
.	O
</s>
<s>
Even	O
with	O
a	O
dope	B-Data_Structure
vector	I-Data_Structure
,	O
having	O
(	O
only	O
)	O
a	O
pointer	O
to	O
a	O
particular	O
member	O
of	O
an	O
array	O
does	O
not	O
enable	O
finding	O
the	O
position	O
in	O
the	O
array	O
,	O
or	O
the	O
location	O
of	O
the	O
array	O
or	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
itself	O
.	O
</s>
<s>
Such	O
per-element	O
information	O
can	O
be	O
useful	O
,	O
but	O
is	O
not	O
part	O
of	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
.	O
</s>
<s>
Dope	B-Data_Structure
vectors	I-Data_Structure
can	O
be	O
a	O
general	O
facility	O
,	O
shared	O
across	O
multiple	O
datatypes	O
(	O
not	O
just	O
arrays	B-Data_Structure
and/or	O
strings	O
)	O
.	O
</s>
