hey, I am using the code below to search a text file for double quotation marks, it seems not to be working because the result is returning 0 zero
Code:
/*Function counts the number of double quotation marks*/
void N_Quotations(FILE *fptr,int quotes)
{
fptr=fopen("lammin.txt","r");
char numb_quotes; /*numb_quotes searches the file for quotes*/
char n_quotes ='"'; /*n_quotes is a constant*/
int quotes=0; /*quotes reps. the counter*/
while(!feof(fptr))
{
fscanf(fptr,"%c",&numb_quotes);
if(numb_quotes == n_quotes)
{
quotes++;
printf("%c",numb_quotes);
}
}
printf("The Estimated Number Of Double Quotation Marks Are %d \n",quotes);
fclose(fptr);
}