How do read and write a BMP file by passing pointer to std::vector<char>?

I have done it using vector, the syntax is given like std::vector<char>, the function should differ from one another in passing, so I thought if I use in my code below like this std::vector<char>*vec it woulld work but unfortunately not, please any help would be appreciated.

[code]

#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <stdio.h>
#include <ostream>
#include <time.h>
#include <algorithm>
#include <iterator> 
#include <iostream>
#include <iterator>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

using namespace std;

//passing pointer not working
void use_pointer()
{

std::ifstream source("fruit.bmp", std::ios::binary);
std::vector<char>*vec((std::istreambuf_iterator<char>(source)),
                     std::istreambuf_iterator<char>());

for(unsigned int i = 54; i <vec.size(); i++)
vec[i] = 255-vec[i];

ofstream fout("data.dat", ios::out | ios::binary);
fout.write((char*)&vec[0], vec.size() * sizeof(char));
fout.close();
}

//using vector working 
void use_vector()
{

std::ifstream source("fruit.bmp", std::ios::binary);
std::vector<char> vec((std::istreambuf_iterator<char>(source)),
                     std::istreambuf_iterator<char>());

for(unsigned int i = 54; i <vec.size(); i++)
vec[i] = 255-vec[i];

ofstream fout("data.dat", ios::out | ios::binary);
fout.write((char*)&vec[0], vec.size() * sizeof(char));
fout.close();
}

int main(int argc, char* argv[])
{
if (argc >= 4) {

int count = 10;
cout << "Inverting file \n" << endl;
for(count;count < 110; count+=10){
cout <<count<<"%"<<" ";
fflush(stdout);

sleep(1);
}
cout << endl << "Done\n" <<endl;

std::cerr << " " << argv[0] << " Your BMP file is inverted\n" <<               
std::endl;
double dStart=clock();
use_vector();//Done
//use_pointer();// got stuck
double dDuration=clock()-dStart;
cout<<"Time estimation\n"<<endl;
cout<<dDuration/CLOCKS_PER_SEC<<"sec"<<endl;

return 1;

}
// Print the user's name:
std::cout << argv[0] << " hello, " << argv[1] << "Zesan" << std::endl;
return 0;
}

[/code]