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
