Why is this not getting every single line of the book, the page number, and storing it in the vector?? This is the driver file that runs through the file, gets the line, strips the line into words, then passes those words to the addWord function:

Code:
    Index create;

    int thePageNum = 1;
    while(book.fileOfBook)
    {
        for(int lineNumber = 0; lineNumber < MAX_LINES_PER_PAGE; lineNumber++)
        {
            string theLine = book.readLine();
            char * pch;
            pch = &theLine[0];
            pch = strtok (pch," :#;[]""\"()!*`1234567890'?,.-");

            while (pch != NULL)
            {
                for(int i = 0; pch[i] != '\0'; i++)
                    pch[i] = tolower(pch[i]);
                string words(pch);
                create.addWord(words, PageNo);
                pch = strtok (NULL, " :#;[]""\"()!*`1234567890'?,.-");
            }
        }
        create.output(indexOut, book.theTitle);
        thePageNum++;
    }
This is the addLine function:

Code:
void Index::addWord(string word, int pageNumber)
{
    indexWord index;
    index.value = word;
    index.locations.push_back(pageNumber);
    data.push_back(index);
}
I try to cout the variable "value" from the struct indexWord and it only goes to line MAX_LINES_PER_PAGE. I need it to run through the whole book. Is there something I am doing wrong?