
저는 Macbook Air에서 Visual Studio를 병렬로 실행하고 있습니다. 처음으로 C++를 사용하여 txt 파일을 열었는데 디버깅할 때만 작동하는 것 같지만 디버깅하지 않고 실행할 때는 작동하지 않는 것 같습니다.
예제 코드:
ofstream outfile;
outfile.open("Subscription.txt");
if (outfile.is_open())
{
outfile << name << "\n";
outfile.close();
cout << "Welcome to the discount club!" << endl;
}
else
cout << "file won't open" << endl;
로컬 디버거에서 실행하면 "Welcome to.."가 출력되고 디버깅하지 않고 실행하면 "파일이 열리지 않습니다"가 출력됩니다.
아마도 일종의 Mac/Parallels 문제일까요?