Advertisement

freading bitmaps

Started by August 04, 2000 09:53 PM
1 comment, last by oWen 24 years, 4 months ago
Hey, I was playing around with fread and fwrite, and I made this simple program where I could read a file into memory (it was an html file) and then output it to another file, and its contents were intact. I tried the same thing with a bitmap, and it didnt work. I''m opening and reading a binary file, and im using an unsigned char to hold the data from the file. Without posting any code, what could I be doing wrong?
Are you opening the file in text mode? That may be a problem. Use binary mode.


"If you have any questions you may direct
them to that brick wall over there." - South Park
Advertisement
Assuming you're making a straight copy of the file (which is what it sounds like), the only thing I can think of off the top of my head is that you're doing the reading/writing in text mode instead of binary mode. I believe text mode does a little bit of stuff with newline characters or something... and since a html file is a text file, that would explain why it worked in that case. Just a guess, but its worth a shot.

--Agh.. thats the fifth time someones answered a question at the same time as I did.. oh well.. I wont delete it this time.. just because.

Edited by - A. Buza on August 4, 2000 11:09:14 PM

This topic is closed to new replies.

Advertisement