将System :: String ^转换为Int [英] Converting System::String^ to Int

查看:209
本文介绍了将System :: String ^转换为Int的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!我有很长时间的解析问题 - 我无法将System :: String ^转换为int。我试图让Marshalling采用const char *,但是通过(int)cast转换为int会给我带来不好的结果,我看错了大数。

Hello! I have unsolver question for long time - I cannot convert System::String^ to int. I tried to make Marshalling to take const char*, but converting to int by (int) cast gives me bad result, which I see in wrong big number.

请帮我找一个解决方案!

Please, help me to find a solution!

谢谢!

推荐答案

Int32.TryParse:    " 将指定样式和特定于文化的格式的数字的字符串表示形式转换为其等效的32位有符号整数。返回值表示转换是否成功。"
Int32.TryParse:     "Converts the string representation of a number in a specified style and culture-specific format to its 32-bit signed integer equivalent. A return value indicates whether the conversion succeeded."


这篇关于将System :: String ^转换为Int的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆