hii everyone1…
how can i update a text file i,e only one particular record in a file i’m using openGL with vc++ … my sample code to write into a text file when a store button is clicked is over here…after every 8sec i have to update only x_quad and y_quad how can that be done…can any one help me out??
case STORE_BUTTON:
fptr=fopen (“target.txt”, “w”);
fclose(fptr);
fptr=fopen(“target.txt”,“a+”);
if(radiogroup_item_id==0)
strng=“incomming”;
else if(radiogroup_item_id==1)
strng=“outgoing”;
compute(az,sr,er,strng);
if(no>=1)
{
no=no-1;
if(tid <= 10)
{
printf("STORE Button clicked....Stored to a file!
");
fprintf(fptr, "Target id=%d
", tid);
fprintf(fptr, "%s
", strng);
fprintf(fptr, "speed=%f
", speed);
fprintf(fptr, "Azimuth=%d
", az);
fprintf(fptr, "Heading=%d
", hh);
fprintf(fptr, "Start range=%d
", sr);
fprintf(fptr, "End Range=%d
",er);
fprintf(fptr, "Point: %f, %f
", x_quad, y_quad);
}
else if(no==0 || tid>10)
fclose(fptr);
}
tid++;
break;