As to why the output doesn't show characters 32-47, the character (achar) being output is initialized to '0', not to 0x00.