Hi,
now i have work on it for a long time it is working but,
when it can not find the item any how it will print item not found + item found , i have no idea what is wrong any help welcome,
thanks
....
...
..
if( (strcmp(s->Aname,nAname)==0) && (strcmp(s->Oname,nOname)==0) )
flag=1;
if(flag==0)
{
printf("*********************************************************************\n");
printf("******************* can not find item ********************\n");
printf("*********************************************************************\n\n\n");
}
rewind(fp);
fflush(stdin);
while( fread(s,recsize,1,fp) == 1)
{
if( (strcmp(s->Aname,nAname) != 0) || (strcmp(s->Oname,nOname) != 0) )
fwrite(s,recsize,1,ft);
}
if(flag == 1)
printf("*********************************************************************\n");
printf("******************* item found ********************\n");
printf("*********************************************************************\n");
fclose(fp);
fclose(ft);
remove("autotiedot.bin");
rename("temp.dat","autotiedot.bin");
fp=fopen("autotiedot.bin","rb++");
fclose(fp);