oh ok, now I understand your question.
Ok, first of all you need to load the pixel data of the file into memory. Having an array like this is good enough.
unsigned char *data = new unsigned char[width*height*bpp]; // where bpp is bytes per pixel
then load the pixel data from the file into that array. Parsing files depends from format to format. But since your loading BMP files, then its easy (if no compression is applied). Its just a matter of copying. All you need is to point the file pointer to the pixel data and do a fread() or similar in a for loop. To make the pixel data consistent with the RGB sequence instead of the BGR sequence just do this:
for (int i=0;i<height;i++)
int index = i*width*3;
data[index+j*3+2] = read8BitValue(filePtr, bytesRead);
data[index+j*3+1] = read8BitValue(filePtr, bytesRead);
data[index+j*3] = read8BitValue(filePtr, bytesRead);
Lets say for the sake of clarity that you are loading a 24-bit image, then each 4 indicies of the array would represent a pixel. e.g. data represents the blue, data green, data blue, etc...
To write all that to a file, all you need to is to fwrite() the data array to the file. You will also need to store other information, like width, height, depth, etc... in the file.
I hope I answered your question. I can post a whole demo on loading BMP files if you want, but then it would be worth to make it a tutorial for the general public.