need help...c++ using strings...difficult for me
can someone help me out here. I have 2 documents named Emma and Letter. The file contained Emma has a lot of introductory material which I need to skip. Easiest way is to hunt for the string "Chapter I". Then start with file position marker on the first line. The way this works is with groups of 3 words from letter.txt. The first word says how many lines you need to move down in the text by the number of letters in the words. Second word tells you the word on that line by the number of letters in the word. Third word, use the length of the word to find the particular letter. Repeat thus until the letter or character found is a period(.). The output should be "timeisimportant"
Example, the letter.txt document starts like this:
Hi cousin,
I might be at school with you soon............
So you would use Hi, cousin and I as first, second, and third word. And use the directions in Emma to find each letter. And keep repeating.
Here is my code so far: (which is not much)
Code:
int main()
{
ifstream inputFile;
ifstream input;
string a, w, x, z;
a = "CHAPTER I";
inputFile.open("Emma.txt"); // opens the txt file
input.open("Letter.txt");
while (w != a)
getline(inputFile, a);
while (!input.eof())
getline(input, z);
input >> ;
return 0;
if you are to offer help please keep it simple as I prob. am not as advanced as most of you. Thanks