i found it difficult to follow some of your code
so i wrote a simple one real quick and if you can follow it maybe you will see something to help you out.
Code:
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
FILE * myfile;
myfile = fopen("myvowelfile.txt","r");
int myVowel;
int numofvowels = 0;
myVowel = fgetc(myfile);
while(myVowel != EOF)
{
if(myVowel == 'A' || myVowel == 'a')
{
numofvowels++;
}
if(myVowel == 'E' || myVowel == 'e')
{
numofvowels++;
}
if(myVowel == 'I' || myVowel == 'i')
{
numofvowels++;
}
if(myVowel == 'O' || myVowel == 'o')
{
numofvowels++;
}
if(myVowel == 'U' || myVowel == 'u')
{
numofvowels++;
}
if(myVowel == 'Y' || myVowel == 'y')
{
numofvowels++;
}
myVowel = fgetc(myfile);
}
cout << "You have " << numofvowels << " Vowels in your file!" << endl;
getch();
return 0;
}