C++ easy way to convert int to string with unknown base
c++, int, string, type-conversion
Solution
although `std::strtol` is more flexible, in a controlled case you can use `itoa` as well.
int a = 456;
int b = 5;
char buffer[32];
itoa(a, buffer, b);
Problem
Here is code in Java: ``` int a = 456; int b = 5; String s = Integer.toString(a, b); System.out.println(s); ``` Now I want the same in C++, but all the conversions i find convert to base 10 only. I ofc dont want to implement this by mysleft, why to write something what already exists