I am trying to write a c++ program that reads through a text file and when i comes across a specific line it adds to that file. i have this code, but it doesnt write "meow" until the end of the text file.. does anyone know how i can get it to write meow on the line after "putwordhere"?? ??????????

#include <iostream>
#include <fstream>
#include <string>
using namespace std;...