On Tue, Dec 29, 2009 at 10:50 AM, Roshan kubunturos@gmail.com wrote:
List,
I have been trying to search on reading an image file via C. I haven't been able to find code without libraries. However, being aware of the 'binary' mode in Windows (Turbo C++), I had read it using fopen, fread and fseek to read the header and then the contents. However, this reading was done reading individual bytes and not reading it using structures.
Chuck fopen and fread. Use open(2) and read(2) instead and read out the bytes into an unsigned char array. This should also work cross-platform without hassles.
Oh yeah, and chuck turbo c++ too ;)