A
arganx
The following does not work when opening a file that contains a space
in the name. It works perfectly on files that have no space in the
name. Any ideas on how to make this work? Surely I shouldn't have to
manually change the file names first.
char hand[30];
cout<<"enter file name: ";
cin>>hand;
ifstream myfile (hand);
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
Any help would be appreciated.
in the name. It works perfectly on files that have no space in the
name. Any ideas on how to make this work? Surely I shouldn't have to
manually change the file names first.
char hand[30];
cout<<"enter file name: ";
cin>>hand;
ifstream myfile (hand);
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
Any help would be appreciated.