Re: Combining Numbers to String

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Try

int n1 = 91;
int n2 = 341;
CString buff;
buff.Format(_T("%d%d"), n1, n2);
int n = _tstoi(buff);

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com


"Charles Tam" <CharlesTam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D62476DA-C882-4048-96F0-97C18883CD49@xxxxxxxxxxxxxxxx
> How do I combine two numbers into a string?
>
> For example, combining 90 and 01 into "9001" and then convert it into 9001
> as a number? Any ideas?


.



Relevant Pages