How to change any integer to string or string to integer?

please explain me by any simple example code so i can use in my code when i will use in the program.

@kailash_01 hey,you can use direct functions in C++ to do so.For converting integer to string use to_string function,here is eg:
string s=to_string(1);
cout<<s;
//1 is string
output:1
To convert string to integer stoi function can be use ,here is eg:
string str1 = “45”;
int myint = stoi(str1);
//45 will be integer
cout<<myint;

Hope you get it.Feel free to ask any doubt.Rate your experience and give feedback.Happy coding :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.