int main(int argc, char** argv)
{
FILE *f;
char string[100];
int counter=0;
f=fopen("New Text Document.txt","r");
if (f==NULL)
{
printf("error");
}
while(!feof(f))
{
fscanf(f,"%c",&string);
}
fclose(f);
for(int i=0;i<100;i++)
{
if (string[i]=='a') /*doesnt work, why?*/
{
counter++;
}
}
printf("\n the number of vowels a is : %d",counter);
getch();
return 0;
}
the counter does not increment, i m not sure why.