Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I noticed to my glee that C++11 has a std stoX family of functions for easily unpacking ints/floats/longs whatever from strings. I'm surprised however, that the opposite isn't implemented. Why didn't the standards committee include a std::itos family of functions for going from ints/floats/whatever to strings?

share|improve this question

1 Answer 1

up vote 22 down vote accepted

I was mistaken, there is a set of "stoX" functions, they are all just named "to_string". Each to_string is overloaded to take a different basic type, ie

string to_string(float f);
string to_string(int f);

See here for more info.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.