Solved

Convert INT to CString

Posted on 1998-12-22
2
384 Views
Last Modified: 2013-11-20
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
Comment
Question by:Sol
2 Comments
 
LVL 3

Accepted Solution

by:
plaroche earned 20 total points
ID: 1326584
CString final;

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

0
 
LVL 1

Expert Comment

by:The_Brain
ID: 1326585
char buffer[x];

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

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 78
EvenOdd challenge 10 108
Thin secure Windows 10 5 97
how to use laptop or pad camera in vb.net windows application 2 71
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question