[Mono-list] Mono-list Digest, Vol 30, Issue 30

Adrien Dessemond adrien.dessemond at softhome.net
Mon Oct 29 11:52:23 EDT 2007


On Mon, October 29, 2007 12:15 pm, Ashish Goyal wrote:

Hi Ashish,

> Hello, How can I find that The Mono I am running on the system is 32-bit
> or
> 64-bit?

A much cleaner apporach may exist (class property/constant somewhere...)
but using an unsafe block can do the trick :

int psize;
unsafe {
  psize=sizeof(char *);
}

Of course when you compile such a code, /unsafe must be given to the C#
compiler. Note that unlike in C, sizeof(char *) is translated in a MSIL
instruction rather than an integer constant.

Kind regards,

Adrien






More information about the Mono-list mailing list