Check out example codes for "to_string in c++". It will help you in understanding the concepts better.

Code Example 1

int i=11;
string str= to_string(i);

Code Example 2

int a = 10;
stringstream ss;
ss << a;
string str = ss.str();

Code Example 3

// EXAMPLE
int iIntAsInt = 658;
std::string sIntAsString = to_string(iIntAsInt);

/* SYNTAX
to_string(<your-integer>)
*/

/* HEADERS
#include <string>
*/

Learn ReactJs, React Native from akashmittal.com