Solved

Cross conversion of int and CStrings in VC++ 5.0

Posted on 1998-12-27
1
179 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 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

14 Experts available now in Live!

Get 1:1 Help Now