Re: Roll your own std::vector ???
- From: "Joanna Carter [TeamB]" <joanna@xxxxxxxxxxxx>
- Date: Sun, 17 Dec 2006 22:20:26 -0000
"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> a écrit dans le message de news:
pVihh.19892$Rj.19203@xxxxxxxxxxxxxxx
| The commonly understood basic principle where an array name is
| one-and-the-same-thing as an array address.
In that case, that would appear to be the principle for all .NET types. The
variable that you see *is* the object that the variable points to. There is
no indirection on the surface, even though the underlying framework may
involve such.
I think the thing that you are having trouble with is this lack of
indirection; when it comes to C#, you need to try to forget about ->, & and
* and simply think of variables as being one and the same as the object
which they hold. For the sake of your comprehension, forget about pointers
and addresses :-)
| Yes that is what I was talking about, they are both pointers within the
| underlying architecture.
Maybe but that should not concern you; forget pointers :-)).
| > As I said in my previous post, the contents of value types are copied on
| > assignment, but those of reference types are simply "pointed to" by the
| > second reference.
|
| Array.Copy(ia, temp, ia.Length);
| ia = temp;
|
| So the last statement contains two reference types, even though the
underlying
| type of array element may be a value type or a reference type ???
Array is a reference type, regardless of the type that it holds. See Jon's
post as well.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
.
- Follow-Ups:
- Re: Roll your own std::vector ???
- From: Peter Olcott
- Re: Roll your own std::vector ???
- References:
- Roll your own std::vector ???
- From: Peter Olcott
- Re: Roll your own std::vector ???
- From: Joanna Carter [TeamB]
- Re: Roll your own std::vector ???
- From: Joanna Carter [TeamB]
- Re: Roll your own std::vector ???
- From: Peter Olcott
- Re: Roll your own std::vector ???
- From: Joanna Carter [TeamB]
- Re: Roll your own std::vector ???
- From: Peter Olcott
- Re: Roll your own std::vector ???
- From: Joanna Carter [TeamB]
- Re: Roll your own std::vector ???
- From: Peter Olcott
- Roll your own std::vector ???
- Prev by Date: Re: Roll your own std::vector ???
- Next by Date: Re: Roll your own std::vector ???
- Previous by thread: Re: Roll your own std::vector ???
- Next by thread: Re: Roll your own std::vector ???
- Index(es):
Relevant Pages
|
Loading