RE: [Dev-C++] RE: Int value to string
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: James G. <Jam...@cl...> - 2000-12-07 11:57:24
|
It's in stdlib.h as 'char* itoa (int nValue, char* sz, int nRadix);' Regards, James. -----Original Message----- From: Ioannis Vranos [mailto:no...@ya...] Sent: Thursday, December 07, 2000 11:15 AM To: dev...@li... Subject: RE: [Dev-C++] RE: Int value to string I don't think that there is any itoa() function in C standard library. > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > exc...@sp... > Sent: Thursday, December 07, 2000 9:15 AM > To: dev...@li... > Subject: [Dev-C++] RE: Int value to string > > > >How to convert, cast, transform, whatever a >int value to a string? > First, include stdlib.h. > Then add another string to hold the myInt value: > > char myApples[20]; > > Then all you have to do is insert this line of code: > > itoa(myInt, myApples, 10); > > This line of code takes an int (myInt), and converts it to a > string (myAples), with base 10. If you want the number in hex, > write 16. If you want it in binary, write 2. > > /Orjan > > > _________________________________________s_p_r_a_y_ > Här börjar Internet! > Skaffa gratis e-mail och gratis Internet på http://www.spray.se > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/mailman/listinfo/dev-cpp-users > __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com _______________________________________________ Dev-cpp-users mailing list Dev...@li... http://lists.sourceforge.net/mailman/listinfo/dev-cpp-users * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This electronic message and any attachment is intended to be read by the named addressee(s) only. Any other recipient should be aware that its contents may be legally privileged and/or confidential and that its use, disclosure, copying or distribution may be unlawful. Unless you are a named addressee, please delete this message Whilst C. & J. Clark International Limited has taken steps to prevent the transmission of computer viruses with electronic mail, responsibility for screening incoming messages and the risk of such transmission and its consequences lies with the recipient. C. & J. Clark International Limited Registered in England and Wales Company No. 141015 Registered Office: 40 High Street, Street, Somerset BA16 0YA Telephone: +44 (0) 1458 443131 Fax: +44 (0) 1458 447547 |