简体   繁体   中英

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?

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.

Yes that's correct!

Hope I saved your sanity.

在VB.NET中,数组枚举从1开始

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM