convert an integer manually into an char array for printing to console