```
char BOOK::retname()
{
    return name;
}
void BOOK::searchbook()
{
    clrscr();
    int flag=0;
    char name2[30];
    FILE *fp;
    cout<<"Enter Book Name: ";
    cin.get();
    gets(name2);
    char name1=retname();
    fp = fopen("Records.txt","rb");
    while(fread(&BOOK,sizeof(BOOK),1,fp)==1){
        if(strcmpi(name1,name2)==0)
            {
                flag=1;
                cout<<"This book is available: ";

    }       }
}  

```

I'm getting a few errors here like invalid conversion from char\* to char.  

 I'm new to file handling questions so debugging is out of my thinking scope.  

Please don't butcher me for using gets()  

Thank you  

PS : char name is private member of class BOOk  

 I think I cannot equate string name with a plain char name1 in line14 but I don't know how to fix that.  

**EDIT** I'm now getting the error at line 16  

"expected primary-expression before ',' token"  

**EDIT** I got it to work, thanks anyways peoples!! Please lock this thread mods