Convert INT to CString

I have an integer stored in integer variable i ( example int i=1)

I have a string stored in CString variable (example CString def="D")

Now, i want a new CSTRING variable called FINAL defined as the older CString called def plus the integer i.

In other words, i want a CString variable called final that contains, following the example, the string  "D1"

How can i do that??

THANKS ALL!!

SolAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
plarocheConnect With a Mentor Commented:
CString final;

final.Format(_T("%d"), i);
final = def + final;

0
 
The_BrainCommented:
char buffer[x];

strcat(Def, _itoa(i , buffer, 10));
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.