Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who invented the zero based
Message
De
24/11/2011 09:16:34
 
 
À
24/11/2011 09:04:26
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01529748
Message ID:
01529749
Vues:
98
>I've been thinking about this this morning. Who invented the zero based approach, which applies to a lot of things in several development environments, including, among others, .NET. This is always a waste of time trying to understand/find which one applies to a specific component. I mean, when I start counting, I start at 1, right? lol


Has been there at least since C - which must be the seventies

Think of zero based as an offset

It does have its advantages. If you start counting from zero, the address where element n starts is the startAddress + n * widthOfElement

For one based it would be startAddress + ( n-1) * widthOfElement

Zero based : for 0 to count-1
One based : for 1 to count
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform