srand((unsigned)time(0));
int random=rand() % 3 + 1;
SetConsoleTitle("PotatoOS v1.1");
string input;
string output;
bool word(char *Filename,int number);
std::fstream readFile; //for reading from the file
ofstream createFile; //for making the file
createFile.open("Brain.txt"); //made the file
createFile<< "whats up?\ni am happy\nyou seem nice"; //what is in the file
createFile.close();
start:
{
readFile.open("Brain.txt"); //initializes the file
for(int i=0; i<random; i++) getline(readFile,output); //gets a random line
cout<< ""<<output<<"\n"; //prints the line
getline(cin, input); //gets user input
readFile<< ""<<input<<""; //supposed to save input to file but doesn't
readFile.close(); //closes the file
I do not understand why this isn't working. It is supposed to take the "input" and save it to the file "Brain.txt". Everything works except that it doesn't update the file to contain "input".