okay, experts, i need help.
i can't seem to replace characters in a file, like i thought i would be able to:
here's an example code. i put print and error stuff in there to try and debug. everything seems to be working ... except that my filename is not modified.
any help greatly appreciated.
if ((fptr = fopen (filename, "ab+")) == NULL)
{
printf("File Open Error %s", filename);
exit(0);
}
rewind (fptr);
for (inx=1; inx<MTDF_HEAD_DURATION; inx++) // looking for 10th line...
{
fgets (buf, 90, fptr);
printf("%s (%p)\n",buf,fptr);
}
errno = 0;
for (inx=0; inx<strlen(MTDF_Header.Duration); inx++) // replace w/str "0001359"
{
result = putc (MTDF_Header.Duration[inx], fptr);
printf("result: %d, errno: %d\n",result,errno);
}
fclose(fptr);