博客园 :: :: 博问 :: 闪存 :: 新随笔 :: :: :: 管理 ::
#include <stdio.h>

//蜘蛛纸牌存档文件,读取分数。
int main(void)
{
	FILE *rfile;	
	int p[20];
	
	rfile = fopen("d:\\spider.sav","rb+");//只能用rb+,不能用wb
	fseek(rfile,368,SEEK_SET);//368是170的十六进制,这个位置是要修改的内容所在的位置。
	fread(p,2,2,rfile);//重要

	printf("%d\n",p[0]);
	
	fclose(rfile);
	return 0;
}

  

posted on 2015-01-18 15:48  #include<stdio.h>  阅读(569)  评论(0编辑  收藏  举报