Convert int to string without itoa?

Hi all,

I'm searching for a way to convert an int into a string without the use of itoa. I can't use itoa because I run the code on a unix machine and it only has the standard functions. And itoa() is not partof them.

So do you have an idea on how to convert an into into a string without itoa()?

Thanks in advance, Rope.

Never mind already found it.
Last edited on
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <sstream>

int main() {
  int number = 123;

  std::stringstream ss;
  ss << number;

  std::cout << ss.str() << endl;
}
Topic archived. No new replies allowed.