Lendo e escrevendo arquivo binário

Estou tentando escrever código para ler um arquivo binário em um buffer e depois gravar o buffer em outro arquivo. Eu tenho o código a seguir, mas o buffer armazena apenas alguns caracteres ASCII da primeira linha do arquivo e nada mai

int length;
char * buffer;

ifstream is;
is.open ("C:\\Final.gif", ios::binary );
// get length of file:
is.seekg (0, ios::end);
length = is.tellg();
is.seekg (0, ios::beg);
// allocate memory:
buffer = new char [length];
// read data as a block:
is.read (buffer,length);
is.close();

FILE *pFile;
pFile = fopen ("C:\\myfile.gif", "w");
fwrite (buffer , 1 , sizeof(buffer) , pFile );

questionAnswers(7)

yourAnswerToTheQuestion