I was using this Dev C++ version 4 to compile to code written to convert the jpeg to exif format. and after trying for 2 hours to debug my code, I came to know the actual bug.
Actually, whenever it encounters 0x1A in the source file, it reads it as 0xFF. I tried fscanf, fgetc, fread, but none of them seem to work with this. When I am reading using fgetc and printing on the stdout, it prints 0xFF, when it should actually print ox1A, and after that the program hangs. I think this is a bug in the compiler :)
yeye, no bug in my code :)
Subscribe to:
Post Comments (Atom)
2 comments:
Opening the file in binary mode (in fopen) doesn't cause this problem
yes, you are right. I was idiot to consider that as a compiler thing. It was a jpeg image, and opening in binary mode should allow to read all the hex data as it is on the disk.
Post a Comment