The following are commonly used conversions between several types to convert string to int .............................. char * to int # include <stdlib. h> int atoi (const char * nptr); long atol (const char * nptr); long Atoll (const char * nptr); long atoq (const char * nptr ); you can use the stringstream class (including the <sstream> header file) int main () {stringstream SS; int I = 100; string STR; SS> I; SS <STR; // in this case, STR is the string "100 ". retturn 0 ;}............................. char * to string S (char *); your class can only be initialized. It is best to use assign () convert to char * In stdlib if it is not initialized. h: ITOA (I, num, 10 ); I need to convert the numeric num to the character, and then save the variable 10 of the character to convert the numeric base (in hexadecimal) 10, that is, convert the number in hexadecimal notation. It can also be 2, 8, 16, etc. You like the base type prototype: char * ITOA (INT value, char * string, int Radix); instance: # include "stdlib. H "# include" stdio. H "Main () {int I = 1234; char s [5]; ITOA (I, S, 10); printf (" % s ", S ); getchar ();}................................... ....... string to char * P = string. c_str (); string AA ("AAA"); char * c = AA. c_str (); string mngname; char T [200]; memset (T, 0,200); strcpy (T, mngname. c_str ());