Hey, Im trying to get the user to type in a file name, and then the program will copy the file to some where else like C:\ or USB or something.
So far this is what I've come up with:
#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <conio.h>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string file;
cout << "Enter name the file, TO THE EXACT WORD!!! eg. \"Hi.txt\" :\n";
getline(cin, file);
system ("copy \" file.c_str \" \"C:\\Ok.txt"\ ");
getch();
return 0;
}
The problem there is that when i do file.c_str(), the system thinks is the name of the file, and says it cannot be found.
Thanks for any help..:icon_neutral: :icon_confused: