importing a picture then outputting it

I am trying to take an image file and output it to a different location with a different name. Here is what i have pieced together so far from my readings, but i dont know how to output it to another file and im not sure im inputing it correctly either.
thanks for the help.

1
2
3
4
5
6
7
8
9
10
11
int main(){
	cout<<"Please enter the file name you wish to import";
	string image;
	cin>>image;
	ifstream import(image.c_str(),ios::in | ios::binary);
	if (!import) error("cannot open input file",image);

        ostringstream output;
	output<<import.rdbuf();
	string data(output.str());
Topic archived. No new replies allowed.