I'm having a problem writing the code for writing a .bmp file. What I'm trying to do right now is load a bitmap then use that same information and write it into another file. The problem is, the first 10 lines or so of pixels in the image I write ends up completely black... I need help =/. Here's the code I'm using.

Code:
BITMAPINFOHEADER bmpiheader;//Info header
BITMAPFILEHEADER bmpfheader;//File header
unsigned int bbuffer[2048]; //holds the image (64x32x32bit)
FILE *fptr; //file pointer
fptr=fopen("first.bmp","rb"); //opens original bitmap in binary

//Reads the header information into the headers
fread(&bmpfheader,sizeof(BITMAPFILEHEADER),1,fptr);
fread(&bmpiheader,sizeof(BITMAPINFOHEADER),1,fptr);

//Reads the image into bbuffer
fread(bbuffer,sizeof(UINT),sizeof(bbuffer),fptr);
fclose(fptr); //closes file pointer

fptr=fopen("new.bmp,"wb");//makes new .bmp file for bin writing

//writes in the headers I got from the other file
fwrite(&bmpfheader,sizeof(BITMAPFILEHEADER),1,fptr);
fwrite(&bmpiheader,sizeof(BITMAPINFOHEADER),1,fptr);

//writes in the image information from the other image
fwrite(bbuffer,sizeof(UINT),sizeof(bbuffer),fptr);
fclose(fptr); //closes file
I can't understand why this makes the first 10 lines completely black...