Converting an int into a base 2 cstring/string
问题 In visual studio on my PC I can use itoa() to convert from a base ten int to a base 2 c-string. However when I am on a Linux machine that function isn't supported. Is there another quick way of doing this kind of conversion? I know how to use a string stream and I can use the dividing and modding to convert to another base manually. I was just hopping that there was an easier way of accessing the binary representation of an int. 回答1: You could use std::bitset<N> with a suitable N (e.g., std: