Now in c++11 we have
#include <string>
string s = std::to_string(123);
Link to reference: http://en.cppreference.com/w/cpp/string/basic_string/to_string
More Related Contents:
- Alternative to itoa() for converting integer to string C++? [duplicate]
- How to concatenate a std::string and an int
- in c++ when i declare an integer variable int a = 200L or int a = 200F or int a = 200U, It allows. How does this happen?
- How to add a number to an integer like a string
- What it is the meaning of this error: conversion from ‘char* [40] to non-scalar type ‘std::string
- Converting std::string from const_iterator to char*?
- How to trim a std::string?
- How to replace all occurrences of a character in string?
- What happens if I assign a negative value to an unsigned variable?
- How can I use cout
- C++ performance challenge: integer to std::string conversion
- Efficient unsigned-to-signed cast avoiding implementation-defined behavior
- Why isn’t `int pow(int base, int exponent)` in the standard C++ libraries?
- Convert String containing several numbers into integers
- performance of unsigned vs signed integers
- Can a std::string contain embedded nulls?
- What does string::npos mean in this code?
- Why don’t the std::fstream classes take a std::string?
- I want to convert std::string into a const wchar_t *
- How can I add and subtract 128 bit integers in C or C++ if my compiler does not support them?
- Difference between long and int data types [duplicate]
- convert a char* to std::string
- Why use !! when converting int to bool?
- C++ floating point to integer type conversions
- C++: how to get fprintf results as a std::string w/o sprintf
- Can I hint the optimizer by giving the range of an integer?
- Long Vs. Int C/C++ – What’s The Point?
- How Can I avoid char input for an int variable?
- Why it is different between -2147483648 and (int)-2147483648
- Most efficient way to check if all __m128i components are 0 [using