Well, After 15 days of trying to get an answer for how the outputed file was being corrupted and how to fix it, in 30 minutes my problem was solved here. The setmode() function solved my problem. I didn't use it up to now because all my references, including cplusplus.com doesn't have any citation of this function. Thanks a lot to Ingo Krabbe and even more to Eljay John, for this simple resolution of my problem. Even programming games using Allegro and SDL, programming in lots of languages and programming lots of applications for a large company here in Brazil, I can't get where you all are, but one day I'll be here to help people like you all do! Gratefully again, Thales Medeiros. Citando John Love-Jensen <eljay@xxxxxxxxx>: > Hi Thales, > > I did not realize you were using C-style input/output. > > Try this before using stdout for anything else: > setmode(fileno(stdout), O_BINARY); > > HTH, > --Eljay ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.