Link to home
Start Free TrialLog in
Avatar of rwallacej
rwallacej

asked on

C# querying array statement

Hi
I have a question regarding arrays in C#.

The line of code                  

jagged[1][5] = 20;

is described as "the value 20 is assigned to the fifth element of the first array"

Would I be right in saying that this isn't really the case, and rather it is to the Second array.?

 jagged[0][5] would be first array

Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think in VB you can specify the beginning bound (so could be 1..n, 1..n not zero based) - so it could well be the fifth in the first.  But as this is concerning C# the comment by Idle_Mind is correct.
Yes, classic VB allowed custom ranges, but VB.Net forces it to 0 (zero):
http://support.microsoft.com/kb/311333
Aha, thanks  -  guess who doesn't use VB.net ;-)
Yes lower bound of array in .net is 0(Zero), but we are having a workaround to make other as lower bound like in VB 6.0.

This is done using custom class. Refer to following link:

http://blogs.msdn.com/b/vbfaq/archive/2004/04/20/116660.aspx
Avatar of rwallacej
rwallacej

ASKER

thank-you kindly