its probably because what you see in the ascii editor are not spaces at all. Many editors, such as Notepad will display non-printable characters as spaces. What makes you think that file contains spaces? binary files contains all sorts of stuff that are meaningless to ascii edits. If you realy want to see what is in the file, and you are on MS-Windows os, you can use debug.exe that is in the MS-Windows installation directory -- that program has been distrubuted with every M$ operating system since MS-DOS 1.0 over 20 years ago. It has a split screen. On the left side is the hex values of every byte in the file. The right side contains the ascii values where non-printable bytes are displayed as a '.' (period).
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
The >> operator strips the spaces. If you want to retain them use read() function.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343