(already answered on reddit, just for this question to have an answer)
fwrite(&pixel, sizeof(RGBTRIPLE), 1, outptr);
fwrite(&pixel[hor], sizeof(RGBTRIPLE), 1, outptr);
fwrite(pixel + hor, sizeof(RGBTRIPLE), 1, outptr);
&pixel[hor] and pixel + hor both represent the memory address of the horth element of pixel....
I see two problems with your code. Both are here:
if (fread(buffer, 512, 1, file) != 512)
First, if the fread works correctly, it will return 1 here, not 512. The value returned is the number of elements returned. The third parameter tells how many elements to read, ...
Per the advice on the front page of the course, if you completed problem set 3 in 2018, you need to start with 2019 Week 3 (and 2019 problem set 3). 2019 pset3 is whodunit/resize/recover. I'm going to assume that if you said you did 2 out of 3 of pset4-2018, you did whodunit and resize; if that's correct, then you need to complete Recover (https://docs....
Two things in the scale down code seem odd to me.
for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++)
with the fseek at the end. You skip lines in the input file, but that does not reflect in the loop code. This explains the extra lines you see, with full padding at the end. Either use the output height instead of input height, or ...