I'm doing a basic course at uni and i have an assignment where i have to prompt the user for a file name; find if the file exists, and then propt the user for a word to find in the file, and then a word to replace in the file. I then have to replace the word and output this to a new file.
This is what i have done so far, but im unsure of how to do the find and replace stuff!
All help would be very much appreciated; here's what ive done so far..also i cant use <string> cos i havent covered in class, i can only use <cstring>.
Here's my code:
Your help is very much appreciated! Thanks in advamce, amy
using namespace std;
char string_find ;
cout << "Enter an input file: " << endl;
cin >> file;
cout << "File could not be opened" << endl;
cout << "Enter a string to find: " << endl;
cin >> string_find;
cout << "Enter a string to replace with: " << andl;
cin >> string_replace;
outfile << "test";