1.string => int / double / float
stoi(string) / stod(string) / stof(string)
e.g.
string s = "10";
int x = stoi(s);
double y = stod(s);
float z = stof(z);
2.string => c-style string
string.c_str()
e.g.
string s = "hello"
char *str = s.to_str();
3. int => string
to_string(int);
e.g.
int x = 10;
string sx = to_string(x);
4. char => int
e.g.
char ca = '5';
int ia = ca - '0'; // int ia = ca - 48;
5. int => char
int ib = 6;
char cb = ib + '0'; //char cb = ib + 48;
6. c-style string => string (automatically conversion)
e.g.
string str = "hello";
char *s = str;