C++ Hamming code generator