I’ve starting tinkering around with the Fread/Fwrite functions within C. I’m basically working on a program that manipulates data on a CSV file for my month end accounting task. For my CSV files, the Fread function appears to (generally) work properly. I can effectively stream the CSV file onto the screen etc. Occasionally, I get a read error on certain bytes of data fread()!=counted/buffered item and tosses an error.
Out of curiosity, I’ve run my program on non-csv files, specifically a png file. The file appears to run correctly on my program. I can tell this is the case as my program operates as it did for the CSV file. I’ve set the file up to tell me the stats (size in charecters) etc. in another function that I’ve created. I’ve also set up a program that tells me the number of letters/characters the file has (a to z). When I run the picture file, the program seems to normally fill in the statical details from above; however, when I try to view the stream, nothing shows up other than a png and question mark. I would have expected a ton of garbage to show up at a minimum, yet I get nothing. Why is the stream not showing anything, despite the above statistical data appearing to show up? I’m wondering if it has something to do with the buffer or some kind of internal operating system thing.
Thanks for the help.