You can use std::to_string in C++11
int i = 3;
std::string str = std::to_string(i);
More Related Contents:
- Why when i add number to string it shows random text in c++?
- Pointer to string with spaces [closed]
- std::stoi() takes first number in string?
- Easiest way to convert int to string in C++
- c++ parse int from string [duplicate]
- string::size_type instead of int
- Function stoi not declared
- C++ most efficient way to convert string to int (faster than atoi)
- How to create string of strings in c++
- String comparison operators
- C++ deprecated conversion from string constant to ‘char*’
- Why does omission of “#include ” only sometimes cause compilation failures?
- Right way to split an std::string into a vector
- How is std::string implemented?
- How do I concatenate multiple C++ strings on one line?
- What’s the difference between size_t and int in C++?
- C++ Compare char array with string
- How to strip all non alphanumeric characters from a string in c++?
- Passing const char* as template argument
- initializing std::string from char* without copy
- Convert a unicode String In C++ To Upper Case
- Braces around string literal in char array declaration valid? (e.g. char s[] = {“Hello World”})
- Using std::string_view with api that expects null-terminated string
- Fastest way to Convert String to Binary?
- cin.getline() is skipping an input in C++ [duplicate]
- equivalent of Console.ReadLine() in c++
- Memory-efficient C++ strings (interning, ropes, copy-on-write, etc) [closed]
- converting narrow string to wide string
- What’s the difference between istringstream, ostringstream and stringstream? / Why not use stringstream in every case?
- C++ concatenate two int arrays into one larger array