Я могу писать в текстовый файл, затем я использую getline, и я больше не могу писать в файл.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
ifstream infile;
fstream crypto;
ofstream hacker;
string tempString;
string tempString2;
string plaintext;
string line;
string dec;
.
.
.
crypto<<"hello";//write some stuff to file here
use getline(crypto, line, '\n')
crypto<<"hi";//Doesnt write to file anymore.