Firstly I apologize because there are many posts asking similar questions, but I've read over all that I could find, and it appears to me that my logic should be correct. This leads me to believe there is something I'm missing in the execution. My suspicion is that perhaps I'm using fseek incorrectly, but I've been scraping my brain over this for hours. If you could spot anything obvious that I'm doing wrong here and could point me in an appropriate direction, it would be much appreciated! Thanks in advance!

[code removed per academic honesty guidelines]

1 Answer 1


Ok, so I finally figured this one out. My instinct was half-correct when I thought the problem may have been with fseek. It was, but there was nothing wrong with the seek itself, it was that I was seeking back to the beginning of the scanline every time I wrote it. I needed to prevent it from seeking back on the last time through the loop so that it would actually move on to the next scanline. A simple check that j != scale -1 before doing the fseek fixed my issue. Thanks!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .