yes it is possible to convert an integer to a string.
you can do it by using this fonction:
char *_itoa( int value, char *string, int radix )
an example:
#include<stdlib.h>
#include<iostream.h>
void main()
{
char buffer[20];
int number = 7254;
cout<<"buffer = "<<_itoa( number, buffer, 10 );
}
// notice that the last parameter of that fonction neads to be equal to 10 if you want your number to be stored as a decimal value.By choosing 2 as the last parameter would convert your number to binary etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.