| Author: Jins Philip 29 Feb 2008 | Member Level: Gold | Rating:  Points: 2 |
You can't really do this using managed code. C# provides a sizeof operator, but only for value types.
|
| Author: www.DotNetVJ.com 29 Feb 2008 | Member Level: Diamond | Rating:  Points: 2 |
C# has a 'sizeof' operator that returns the size that a field of that type will be. Thus for reference types (class, not struct), it will always return the size of a pointer (4 on 32 bit systems). The sizeof operator can be applied only to value types, not reference types.
Thanks -- Vijaya Kadiyala http://www.DotNetVJ.com Microsoft MVP Me & My Little Techie
|