> I'm getting a "Parameter Count mismatch error" with the following.
>
[quoted text clipped - 19 lines]
>
> What's happening?

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Thanks to everyone for this. I used Control.Invoke (Job, (object) new
object [] {...})
Can someone clean up my mental image. How are arrays stored. For
example, consider this:
object[] x = new object [3];
is "x" a single variable on the stack that is pointing to three
objects on the heap? Or are there 3 variables on the stack, each
pointing to a single object on the heap?
And then, just to make things more complicated, what if I do the
following:
x[0] = new int [3];
It gets a little confusing at this point.
Dom
> > I'm getting a "Parameter Count mismatch error" with the following.
>
[quoted text clipped - 36 lines]
>
> - Show quoted text -
Jon Skeet [C# MVP] - 29 Feb 2008 16:05 GMT
> Thanks to everyone for this. I used Control.Invoke (Job, (object) new
> object [] {...})
[quoted text clipped - 7 lines]
> objects on the heap? Or are there 3 variables on the stack, each
> pointing to a single object on the heap?
x is a single variable pointing to an array on the heap. The array in
turn has three slots, each of which can contain a reference. Each
reference is then either null or a reference to an object.-
> And then, just to make things more complicated, what if I do the
> following:
>
> x[0] = new int [3];
>
> It gets a little confusing at this point.
At that point, the reference within the array is a reference to another
array, which has 3 slots but this time each slot contains an int.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk