468,119 Members | 1,870 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

Single Dimensional arrays

Sim
Hi,

I come from a C background and I heard that in C# single dimensional
arrays are stored in a tree structure internally? Is that true? I know
that's true for jagged arrays but I'm not sure about single dimensional
arrays. Could someone clear this out for me because it's important I
know all the aspects on arrays before I implement what I need to. Thanks

Sim

Nov 15 '05 #1
3 1210
I come from a C background and I heard that in C# single dimensional
arrays are stored in a tree structure internally? Is that true?


No, the items in a single dimensional array are stored sequentially in
memory, like an array in C.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 15 '05 #2
That's just wrong. C# arrays are contiguous arrays internally. Where did you
hear this from?

Bruno.

"Sim" <si***@no.com> a écrit dans le message de
news:3f********@clarion.carno.net.au...
Hi,

I come from a C background and I heard that in C# single dimensional
arrays are stored in a tree structure internally? Is that true? I know
that's true for jagged arrays but I'm not sure about single dimensional
arrays. Could someone clear this out for me because it's important I
know all the aspects on arrays before I implement what I need to. Thanks

Sim

Nov 15 '05 #3
Sim <si***@no.com> wrote:
What about jagged? They're in a tree, right?


Well, it depends what you mean by a tree. A jagged array is just an
array of arrays. Each array itself is stored sequentially in memory,
but the contents of each element is a reference to another array (or
null).

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Sona | last post: by
20 posts views Thread by Parrot | last post: by
16 posts views Thread by rguti | last post: by
5 posts views Thread by Diffident | last post: by
272 posts views Thread by Peter Olcott | last post: by
15 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.