After looking at several similar questions, I still cannot figure out why my code is not working! here is my vertical (this is in the beginning of the outer loop):
if(a <= n)
{
fseek(inptr, -(biWidth2 * (sizeof(RGBTRIPLE) + padding2)), SEEK_CUR);
a++;
}
else
{
a = 0;
b++;
printf("line %i\n", b);
printf("%li\n", ftell(inptr));
}
EDIT:
I have changed the code to the following, but the program still cannot seem to run correctly:
long fgetpos(outptr, pos);
// iterate over pixels in scanline
for (int j = 0; j < n; j++)
{
long pos1 = ftell(outptr);
if(pos != pos1)
{
fsetpos(inptr, pos);
}
...