new function printStrToChar to print str(x) to a char