Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Why do programmers start counting from 0?

Re: Why do programmers start counting from 0?

From: <apdicaprio_at_gmail.com>
Date: 9 Dec 2004 15:08:51 -0800
Message-ID: <1102633731.369524.43680@f14g2000cwb.googlegroups.com>


Wasn't really for speed or space. With memory management, when you create an array, the indexer just does pointer arithmetic. so for an array of 10 ints, you set aside 40 bytes of memory. [0] will give you the starting memory address of the array + 0 * sizeof(int). [1] will give you 1 * sizeof(int) or 4 and so on. Received on Thu Dec 09 2004 - 17:08:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US