tags:

views:

44

answers:

3
+2  Q: 

arrays VB.NET vs c

just a sanity check please:

in VB.NET:

dim myarray(5) as integer

gives six elements 0 to 5

but in c?

int myarray[5];

gives five elements 0 to 4 ?

is this correct?

A: 

In VB.NET array enumeration starts with 1

abatishchev
And this ( http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF ) is why I hate VB.
Peter LaComb Jr.
+2  A: 

Yes, that is correct. VB.NET does this for the benefit of those "programmers" who can't think in terms of zero-based indexing. Element 0 is there, but you're free to ignore it if you wish.

Evgeny
+2  A: 

Yes that's correct!

Hope I saved your sanity, Best regards, Tom.

tommieb75