I'm using Visual C++ Express 2010... and I'm very new to C++.
I want to read a file then remove everything before the word "<--START-->" and rewrite the file with the rest.
Here's the code I've got for reading the file so far:
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream myReadFile;
myReadFile.open("text.txt");
char output[500];
int found;
int line;
if (myReadFile.is_open()) {
line = 0;
while (!myReadFile.eof()) {
myReadFile >> output;
if(line > 20) {
cout << output;
}
line++;
}
}
myReadFile.close();
system("PAUSE");
return 0;
}
Many thanks in advance.