Converting int32 to int

Do I need to convert int32 to int in VS2008 C ++ CLI?

How it's done?

+2


a source to share


3 answers


Just use broadcast:

int32 a = ...;
int b = (int) a;

      



Note that in principle this can lead to problems if you are running on a platform with int

less than 32 bits, but it is unlikely if it is a Windows program.

+1


a source


The C ++ / CLI keyword int

is an alias for System.Int32

. No conversion or casting required.



+5


a source


int value = (int) int32value;

      

+1


a source







All Articles