To my knowledge the bitmap file format does not support 64 bits per component. I'm not aware of any file format that allows such a format (Though id be surprised if one did not exist).
I find it hard to understand why you would need such a VAST range for an image format component.
Edit: Given your comment then yes it is absoloutely possible to adapt that code. Though its worth noting that 0..63 (64 colour levels) is 6-bit. I assume 2 bits are wasted, though.
Its quite simple if it is grayscale and the component is 8bpp. Basically the storage you need is width * height bytes.
char* pBitmap = malloc( bmp.width * bmp.height );
You can then fread the pixels directly into the char buffer above with a single width * height read.
Edit 2:
Ok for 16 bit per component with 4 components you need a struct like this:
struct Pixel16RGBA
{
unsigned short r;
unsigned short g;
unsigned short b;
unsigned short a;
};
and then you'd allocate as follows:
Pixel16RGBA* pBitmap = (Pixel16RGBA)malloc( bmp.width * bmp.height * 4 * sizeof( unsigned short ) );
You would then fread the whole image in, as before, using the size calcluated in the malloc above.