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
Solved

Convert INT to CString

Posted on 1998-12-22
2
393 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.

856 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