Make user directory a variable?
Im trying to make it so that the user can enter the directory of a file and that this file will be read, the problem is i can seem to get the program to use a variable as the directory, this is roughly what i want to happen, with the users directory as 'direc'
Code:
do
{
cout<<"Please Enter the Directory to your Binary File e.g. c:/Documents/file.dat:\n";
cin>>direc;
cout<<"The Directory you entered was "<<direc<<" is this correct? (y or n)\n";
cin>>answer;
}
while (answer==n)
ifstream file(direc, ios::in|ios::binary);
So is this possible? any hints?