In VC6++
How can I convert a long int to a CString
Example: convert i to string and concate
long int i=12345;
CString result="simple question"+i.ToString()
string result is simple question 12345
Thanks so much!!!
In VC6++
How can I convert a long int to a CString
Example: convert i to string and concate
long int i=12345;
CString result="simple question"+i.ToString()
string result is simple question 12345
Thanks so much!!!
The Beginner
you must remember the stantart ansi c... functions like ltoa() and strcat().
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
In C++:
Code:#include <sstream> std::stringstream Stream; int i = 12345; Stream << "Simple question " << i << std::endl;
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Haha, gotta love C#'s ToString() function... which can be used on almost anything.
Devil Panther and Magos are right though... but since this is in the Windows Programming forum, I'll say that you can also use wsprintf().
Last edited by BMJ; 09-03-2004 at 12:51 PM.
CString has it built-in
ggCode:int i = 12345; CString result; result.Format("simple question %d", i);
Thanks for your helps.
I found the answer!!!
The Beginner