Why is my C++ program not working? : <p>I am trying to build a program that reads numbers from "bac.txt" and returns the 2 digit number/numbers (10,11,12,...,99) that appear most frequently. For example if the file "bac.txt" contains 393 17775787 72194942 12121774 it will return 77 and 21. I have managed to build a working function <code>counter(int n)</code> that can count how many times <code>n</code> is found in the file and returns <code>i</code> which is the number of times <code>n</code> has been found. Now I can't seem to find a way to print to the screen the number/numbers that are found most often. I tried to use some kind of for loop but it doesn't work. 
Here is my code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
using namespace std;

int counter(int n){
  int i=0,j=0;
  char x1=n/10+'0';
  char x2=n%10+'0';
  char a;
  char b=NULL;

fstream fisier("bac.txt", fstream::in);
while (fisier &gt;&gt; noskipws &gt;&gt; a) {
        if(b==x1&amp;&amp;a==x2)
        i++;
        b=a;
}
return i;
}
int main()
{
int v[90];
int v1[90];
int i,maxim=0,nr;
for(i=10;i&lt;100;i++)
{
    v[i]=counter(i);
    if(v[i]&gt;maxim)maxim=v[i];
}

for(i=10;i&lt;100;i++)
   if(v[i]==maxim)
   cout&lt;&lt;i;
}
</code></pre>
