So I have been trying to make a simple program to count how many "au" there is in a text. Ran into a problem when everything seems working, except that it stops counting after the first row.
Here's the program:
#include <iostream>
#include <fstream>
using namespace std;
int au ();
int main(){
cout << au() <<endl;
return 0;
}
int au ()
{
ifstream in("duom.txt");
char a='a';
char u='u';
int n=0;
char t, t1;
while (!in.eof())
{
in.get(t);
in.get(t1);
if (t==a&&t1==u) n++;
}
in.close();
return n;
}