Solved

Cross conversion of int and CStrings in VC++ 5.0

Posted on 1998-12-27
1
180 Views
Last Modified: 2010-04-16
I am building a neural net using numerically indexed file names and I need to be able to convert from ints to CStrings. Currently I am getting some strange results using the CString (int) function for conversion. Help.
0
Comment
Question by:Gareon
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 1181074
That's not too difficult, use the following code:
int nMyInt;
CString strMyInt;

nMyInt = 4;// for example ;-)

strMyInt.Format( "%d", nMyInt);

This should work ;-)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now