True but I think Gius wanted to know the size of a type from a Type reference. I think the sizeof(int) was just an example.
^Tum > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:mono-list- > [EMAIL PROTECTED] On Behalf Of Paolo Molaro > Sent: Monday, 4 August 2003 10:43 p.m. > To: 'Mono' > Subject: Re: [Mono-list] Reflection > > On 08/02/03 Thong (Tum) Nguyen wrote: > > Try System.Runtime.InteropServices.Marshal.SizeOf(Type). > [...] > > > From: [EMAIL PROTECTED] [mailto:mono-list- > > > [EMAIL PROTECTED] On Behalf Of Giuseppe Greco > [...] > > > sorry for my stupid question... but does anybody know how > > > can I get the size of a type without using sizeof()? > > > > > > For example, sizeof(Int32) returns 4; how can I obtain the > > > same result using the Type class? > > Marshal.SizeOf is not the same as the IL sizeof instruction. > sizeof(Int32) is always a constant (4) so you don't need it. > > lupus > > -- > ----------------------------------------------------------------- > [EMAIL PROTECTED] debian/rules > [EMAIL PROTECTED] Monkeys do it better > _______________________________________________ > Mono-list maillist - [EMAIL PROTECTED] > http://lists.ximian.com/mailman/listinfo/mono-list _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
