Ok, its been a while since I've done any file input or string manipulation but what I'm attempting to do is as follows
while(infile >> word) {
for(int i = 0; i < word.length(); i++) {
if(word[i] == '\n') {
cout << "Found a new line" << endl;
lineNumber++;
}
if(!isalpha(word[i])) {
word.erase(i);
}
if(islower(word[i]))
word[i] = toupper(word[i]);
}
}
Now I assume this is not working because >> skips the new line character?? If so, whats a better way to do this.