2

Are there any programming languages in which arrays are not zero-indexed?

I.e. the first element of an array is

array[1] 

and not

array[0]
A. N. Other
  • 409
  • 4
  • 14
  • BTW please google before posting, your question title as a query returns the relevant Wikipedia page & Stack Overflow question in the first places. – Mat Aug 03 '17 at 12:19
  • Also, in Perl it used to be possible to specify the first index via `$[`. – choroba Aug 03 '17 at 12:38
  • Sure, I thought that this was a more proper place to have this question answered, than some random Google search – A. N. Other Aug 03 '17 at 12:57

1 Answers1

4

According to Wikipedia the following languages are 1-indexed...

ALGOL 68,
APL,
AWK,
CFML,
COBOL,
Fortran,
FoxPro,
Julia,
Lingo,
Lua,
Mathematica,
MATLAB,
PL/I,
RPG,
Sass,
Smalltalk,
Wolfram Language,
XPath/XQuery
sepp2k
  • 363,768
  • 54
  • 674
  • 675
Mohideen bin Mohammed
  • 18,813
  • 10
  • 112
  • 118
  • Technically, Fortran does not need to be 1-indexed. The programmer can customise this, but 1 is the default. – Silasvb Aug 04 '17 at 13:41