Mmm, the output format that I want is like: 0001110011111111000000001111111100000000.... I tried your code on Cygwin under Windows 2000, and on Linux, but it prints out ASCII characters.