#include <stdio.h> /* standard header, use the angle brackets */ int main(void) { char somechar = 'x'; /* one-byte data */ FILE* fp = fopen("so-data.txt", "r+"); if (fp) { fseek(fp, 5, SEEK_SET); fwrite(&somechar, 1, 1, fp); fclose(fp); } return 0; /* if you are on non-C99 systems */ }
dirkgently
source share