Function for BMP color inverting doesn't work

前端 未结 2 1652
自闭症患者
自闭症患者 2020-12-22 08:12

I wrote some quick code that is supposed to invert colors of a BMP image. I test with a 40x40 dimensional BMP image, created by paint. However the function seem to fill it e

2条回答
  •  执念已碎
    2020-12-22 08:50

    The C11 draft specification has this to say about the problem

    When a file is opened with update mode ('+' as the second or third character in the above list of mode argument values), both input and output may be performed on the associated stream. However, output shall not be directly followed by input without an intervening call to the fflush function or to a file positioning function (fseek, fsetpos, or rewind), and input shall not be directly followed by output without an intervening call to a file positioning function, unless the input operation encounters end- of-file.

提交回复
热议问题