Please help me, I am trying to search a string from a structure which is in a text file, here is the code:

void update()
    char ask;
    fpt= fopen("records.dat", "rb+");
    long int recsize= sizeof(customer);
    printf("recsize: %d", recsize);

    ask= 'Y';
    while(ask== 'Y')
        printf("\nEnter the Product Id to modify: ");


        while(fgets(customer.product_ID, 79, fpt)!=NULL)

            if(strcmp(pdct_ID, customer.product_ID)== 0)
                printf("Comparison Successful");
                printf("No match found");

        printf("\nModify another record(Y/N)");
        ask= getche();


here customer is the structure variable, product_Id is the structure member, record.dat is my text file

Welcome debolin,
Show us your code which writes struct data into a datafile.
Use code tags. Source code must be surrounded with code tags.
for example,

[code=c] ... statements ...