Hey Armin,
Thanks for the response, you bring up a really good point about singles,
doubles, integers, etc. Something I've been thinking about ironically.
Alright, so lookup in help for System.Int32, says its a structure. I can
believe this, and this also makes sense with the allocating and deallocating
of memory dynamically during the runtime and calling of a default
constructor as explanined here
http://www.vbdotnetheaven.com/Code/Jun2003/2036.asp
This is what I don't understand, look up System.Int32, it says it inherits
from System.ValueType. I take it this is implicilty done by the compiler?
I thought the only one that did that in a managed environment was
System.Object. So how can it inherit?
As for the calling of new, with the implicit constructur (because I just
found out you cannot create an argumentless constructor in a struct) that
now makes sense. But created on the stack instead of the heap.
so I suppose it can be concluded that any structure can be created using
CType because of an implicity constructor that no one talks about. =) But
classes cannot.
Facinating isn't it? =)
-CJ
> "CJ Taylor" <(E-Mail Removed)> schrieb
> > Alright, I don't understand that...
> >
> > How does Ctype call the constructor? What if there is no
> > argumentless constructor? When calling the constructor what happens
> > to the old allocated memory? is that object just lost and cleaned up
> > by GC?
> >
> > Sorry for all the questions Armin, I just dont understand how it
> > works.
>
> Very good question.
Well, Ctype does create new Single, Double,
> Integer,... objects but they don't seem to have a real constructor. I
> thought there are other conversions that create new objects, but I didn't
> find a special case, so, if anybody has one for us ....
>
>
> --
> Armin
>
> How to quote and why:
> http://www.plig.net/nnq/nquote.html
> http://www.netmeister.org/news/learn2quote.html
>