- Sep 10, 2005
- 7,458
- 1
- 76
ok here's a short snippet of code I was testing:
#include<stdio.h>
int main()
{
FILE *fin;
int fpos;
fin = fopen("testinput", "a");
fseek(fin, 10, SEEK_SET);
fprintf(fin, "%s", "**CURR**");
fclose(fin);
return(0);
}
testinput contains:
AB X 1984
AC X 1984
AA X 1984
AF X 1984
AE X 1984
AD X 1984
Shouldn't **CURR** be printing at position 10? For some reason the program always prints **CURR** at the very end (under AD X 1984). If there are any syntax errors, it's because I re-typed the code incorrectly (don't know hot to copy/paste through the terminal).
#include<stdio.h>
int main()
{
FILE *fin;
int fpos;
fin = fopen("testinput", "a");
fseek(fin, 10, SEEK_SET);
fprintf(fin, "%s", "**CURR**");
fclose(fin);
return(0);
}
testinput contains:
AB X 1984
AC X 1984
AA X 1984
AF X 1984
AE X 1984
AD X 1984
Shouldn't **CURR** be printing at position 10? For some reason the program always prints **CURR** at the very end (under AD X 1984). If there are any syntax errors, it's because I re-typed the code incorrectly (don't know hot to copy/paste through the terminal).
