IHateMyJob2004
Lifer
- Sep 29, 2004
- 18,656
- 67
- 91
Everything should default to 0. Array indices starting at 0 is not really a feature of a programming language. Its basically forced by the computer architecture. (I mean... you could start at 1, but then you'd have to subtract 1 every time you index into an array or offset a pointer).
Not really talking indices. Just default values. The C/C++ language specs do not require defaults. A compiler can use whatever happens to be in memory as a default if it wants. Java is different. It dictates defaults per language spec. That's all I am saying.
Array indices in C/C++ are just pointers. They pretty much have to be index zero since that is the location they represent. I'm not sure how Java handles arrays per language spec.
