I am taking a beginning C++ class, and would like to convert letters between hex representations and binary. I can manage to print out the hex numbers using:
Like so:
for(char c = 'a'; c <= 'z'; c++){ std::bitset binary(c); //sizeof() returns bytes, not bits! std::cout << "Letter: " << c << "\t"; std::cout << "Hex: " << std::hex << (int)c << "\t"; std::cout << "Binary: " << binary << std::endl; }