3
votes

I am trying to convert a CString to an unsigned int. I have looked up and got results for conversion to unsigned long but couldn't find anything for int as such. 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.

1

1 Answers

4
votes

Use _tcstoul to get unsigned long value from string and then cast the value to unsigned int.