Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display numbers in Static Strings??

Status
Not open for further replies.

Naits

Programmer
Oct 10, 2001
90
NO
I have a INT variable like this;
a = 1;
But when i trie this:
m_Cash = a; //m_Cash is the variable to a Static String.
Then I just get a non readable character.

How can I get the static text to display a?? __________________
Visit my homepage
.: Game universE :.
 
its because it gets your INT variable as an ASCII number and returns you the ASCII character that matches it.

so if you want to convert int to string:

char * itoa(int value);

string to a number:

double atof( const char *string );
int atoi( const char *string );
__int64 _atoi64( const char *string );
long atol( const char *string );
Daniel Cohen Gindi
dcgsmix@gmx.net
 
you can also look into sprintf and Format if it is a CString

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top