when calling putc with integer, make sure integer is only 8 bits long.