C++ function for Generating a Binary Table and converting Dec to Bin