简体   繁体   English

将MFC CString转换为无符号整数

[英]Convert an MFC CString to an unsigned integer

I am trying to convert a CString to an unsigned int. 我试图将CString转换为unsigned int。 I have looked up and got results for conversion to unsigned long but couldn't find anything for int as such. 我已查找并获得转换为unsigned long的结果,但无法找到int的任何内容。 I know this is simple, but its kind of confusing me a bit. 我知道这很简单,但有点令我困惑。

Any suggestions? 有什么建议?

Need something like this: 需要这样的东西:

CString abc;
unsigned int xyz;

xyz = (unsigned int)abc;

Cheers. 干杯。

使用_tcstoul从string中获取unsigned long值,然后将值转换为unsigned int。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM