Code:
while(getline(infile, s))
{
for (int i=0; i<s.size();i++)
{
if(s[i]=='a' && s[i+1]=='n' && s[i+2]=='d')
{
s[i]='A';
s[i+1]='N';
s[i+2]='D';
count++;
}
}
}
This works and gives me the right amount of "and" that I am looking for. If I put a break after the loop then one paragraph "and" are capitalized.
I tried:
Code:
while(getline(infile, s))
{
if (s.find("and")) {
count++;
}
}
After it was mentioned. I seen this on a google search too but it didn't work then either. I am using it wrong I know that. How do you use it correctly? This looks very nice and simple.
I have not yet finished messing with this program, I found lambda's and been reading about that for a few hours. Really cool.....