how to convert int to string c++

C++
#include <string> 

std::string s = std::to_string(42);#include <iostream>  
#include<string>  
using namespace std;  
int main()  
{  
 int i=11;  
  
string str= to_string(i);  
  
cout<<"string value of integer i is :"<<str<<"\n";  

return 0;
}  #include <iostream>  
#include <boost/lexical_cast.hpp>  
using namespace std;  
int main()  
{  
 int i=11;  
 string str = boost::lexical_cast<string>(i);  
cout<<"string value of integer i is :"<<str<<"\n";  
  
}  int a = 10;
stringstream ss;
ss << a;
string str = ss.str();
Source

Also in C++: