I need to convert int32 to int in VS2008 C++ CLI?
开发者_JS百科How is this done?
The C++/CLI keyword int
is an alias for System.Int32
. No conversion or casting is necessary.
Just use a cast:
int32 a = ...;
int b = (int) a;
Note that in principle this might lead to problems if you're running on a platform where int
is less than 32 bits, but that's unlikely if it's a program for Windows.
int value = (int) int32value;
精彩评论