• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 449
  • Last Modified:

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!!

0
Sol
Asked:
Sol
1 Solution
 
plarocheCommented:
CString final;

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

0
 
The_BrainCommented:
char buffer[x];

strcat(Def, _itoa(i , buffer, 10));
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now