i want to edit contents of binary file in which records are stored
record is a structure.
ftp = fopen("stock.dat", "a+" );
case 2: // option to edit record
long int rec = 0, loc = 0;
printf("\n Enter record no :- ");
loc = ( rec - 1 ) * sizeof(a) + ( rec - 1 );
fseek( fpt, loc, 0 );
fread( &a, sizeof(a), 1, fpt );
now problem is that file pointer is positioning properly
but the record is not updated.