We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Visual C++ Int to CString?

BearishSun
BearishSun asked
on
Medium Priority
612 Views
Last Modified: 2012-06-27
Can someone tell me how to convert int variable to CString one, and other way around? Examples for both would be really nice.

I read something about atoi, but havent figured it out, what is radix?

iNumber = 40;
strReturn = strA + ":" + iNumber;

I'm new, dont laugh :P
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
BTA, you could also use '_itoa()' (a radix is the numerical base, e.g. 2 in the binary and 10 in the decimal system), but it'd be more cumbersome:

   char buffer[20];
   int  iiNumber = 40;
 
   _itoa( iNumber , buffer, 10 );

   strReturn = strA + ":" + buffer;
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.