howdy i have a simple question here, that is how to convert an integer to a string ? i tried this but failed:
any help ??? :confused:Code:string s;
char c;
x = (char) 5;
s = "you got a " + x + " here~";
Printable View
howdy i have a simple question here, that is how to convert an integer to a string ? i tried this but failed:
any help ??? :confused:Code:string s;
char c;
x = (char) 5;
s = "you got a " + x + " here~";
Code:Syntax
#include <stdlib.h>
char *itoa (
int value,
char *buffer,
int radix);
Parameters
value
(IN) Specifies the integer value to be converted.
buffer
(OUT) Points to the character array.
radix
(IN) Specifies the base to be used in converting the integer. It must be in the range of 2 - 36.
Return Values
Returns the pointer to the result.
Yeah, read the FAQ. There are examples in there.Quote:
Originally posted by black
howdy i have a simple question here, that is how to convert an integer to a string ? i tried this but failed:
any help ??? :confused:
thanx guys that FAQ really helps :)