Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
0-based indexing?
Message
De
03/08/2002 20:24:56
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00685916
Message ID:
00685945
Vues:
17
Chris,

In C, an array uses a pointer to a particular place in memory. Each array member is at an offset to the first memory location of the array. For example, if you have an array called myArray:
memory_location = myArray + array_index * sizeof_each_array_member
It has been a while since I worked with C. I don't recall if that is officially the reason, but the pointer math is convenient when using zero based loops, etc...

>I am not sure if 0-based indexing is the correct term, but I am wondering why in .NET the first element of an array starts is indexed with 0. I know this is done in 'C', but I can't remember the rational for it.
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform