I know atoi() converts a string to an integer, but how would I put an integer value into a string?
Also, how do I completely clear out a string w/out deleting it?
I know atoi() converts a string to an integer, but how would I put an integer value into a string?
Also, how do I completely clear out a string w/out deleting it?
I believe there is also a itoa (integer to alpha numeric). What do you mean clear out string without deleting?? Or if you just wanna put an integer at the end of string use strcat() adds a string to the end of a string.
Ryan
Another option is sprintf() is <stdio.h>
char str[31];
int num = 1111;
sprintf(str,"%d",num);
cout << "str:" << str << endl;
Also to clear a string:
strcpy(str,"");