I have a file in my Xcode directory for this project, and the program will open it, but when I input something, it won't save to the file. Not sure why.
std::string entry;
std::fstream file;
file.open ("a1bc3.txt", std::ios::out | std::ios::in );
if (!file.is_open()){
std::cin >> entry ;
}
else {
std::cout << "Failed to open.\n" ;
}
file << entry << std::endl ;
file.close();
return 0;