C++11/14/17 provides functions from string to int/long, but what about vice versa?
I wish to convert an integer to a binary string and then prints it, like:
int i = 127;
char buf[20];
ltoa(i, buf, 2);
printf("%032s\n", buf);
I can see
00000000000000000000000001111111
Currently I could only use C style function on different platforms, like on linux I've ltoa, on windows, _itoa_s (cannot be more ugly) ...
But what about c++?
Thanks a lot.