3 ms·
Why do arrays start at 0?
- simonblack 4y agoIt depends on whether you are using the array start as a pointer to a RAM address or as an arbitrary number. Both ways are valid. Lower-level languages like C start their index from zero, Other higher-level languages like (IIRC) COBOL start their indexes from one. Zero-indexed arrays usually have their pointer begin at the address of the start of the array, so first element is at array-start (array+0) = array[0] second element is at array-start+1 (array+1) = array[1] third element is at array-start+2 (array+2) = array[2] and so forth.