[Mono-list] Reflection

Thong (Tum) Nguyen tum@veridicus.com
Sat, 2 Aug 2003 05:00:59 +1200


Try System.Runtime.InteropServices.Marshal.SizeOf(Type).

^Tum


> -----Original Message-----
> From: mono-list-admin@lists.ximian.com [mailto:mono-list-
> admin@lists.ximian.com] On Behalf Of Giuseppe Greco
> Sent: Saturday, 2 August 2003 3:52 a.m.
> To: Mono
> Subject: [Mono-list] Reflection
> 
> Hi all,
> 
> 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?
> 
> Thanks,
> Gius_.
> 
> --
> ----------------------------------------
> Giuseppe Greco
> 
> ::agamura::
> 
> phone:  +41 (0)91 604 67 65
> mobile: +41 (0)76 390 60 32
> email:  giuseppe.greco@agamura.com
> web:    www.agamura.com
> ----------------------------------------
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list