#include <stdio.h>
int main()
{
long i1, k[5], offset;
FILE *stream;
/*
データの出力
*/
stream = fopen("data", "w");
for (i1 = 0; i1 < 5; i1++)
k[i1] = 10 * (i1 + 1);
fwrite(k, sizeof(long), 5, stream);
fclose(stream);
/*
データの入力
*/
stream = fopen("data", "r");
offset = ftell(stream);
printf("現在のオフセットは %ld\n", offset);
fseek(stream, 12L, SEEK_SET); /* ファイルポインタの移動 */
offset = ftell(stream);
printf("現在のオフセットは %ld\n", offset);
fread(k, sizeof(long), 2, stream);
printf(" 入力データは %ld %ld\n", k[0], k[1]);
return 0;
}