Solved

Convert INT to CString

Posted on 1998-12-22
2
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hibernate methods 2 83
haveThree challenge 22 123
mapAB Challlenge 35 174
unix example issues 18 106
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

726 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