Answer the question
In order to leave comments, you need to log in
How to allow file input in the program in MVS?
How to allow the program to read the file stream in MVS during debugging?
Such a program does not work correctly (does not open the file). If you do not run from MVS, everything works fine.
char a;
ifstream creat;
creat.open("1.txt");
while (true)
{
//creat >> a;
creat.get(a);
if (!creat.eof())
cout << (int)a<<' ';
else
break;
}
creat.close();
Answer the question
In order to leave comments, you need to log in
The problem is in the working directory.
In Project -> Properties -> Debugging -> Working Directory we set $(TargetDir)
And the current directory at startup will be the one where the executable file is located. Or you can use an absolute path.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question