我可以写入一个文本文件,然后我使用 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.