|
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
int GetDotArray(char *s, int *a,int n)
{
//n=32;
FILE *file;
int i;
long off_set;
file=fopen("Hzk16.dat","r");
if(file==NULL)
{
perror("fopen");
exit(1);
}
off_set=(94 *(s[0]-0xa0-1) +(s[1]-0xa0-1) )*32;
fseek(file,off_set, SEEK_SET);
fread(&a[0],32,1,file);
for(i=0;i<32; i++)
{
printf("%d\t",a);
if( (i+1)%2 ==0 ) printf("\n");
}
fclose(file);
return 0;
}
int main()
{
int a[32];
unsigned char *t="嵌";
unsigned char *s=t;
while(*s !=0)
{
printf("%5d\t",*s);
s++;
}
printf("\n------------------------------\n");
s="我";
GetDotArray(s, &a[0],32);
}
//得到的结果怎么是 199 182
------------------------------
0 0
0 0
0 0
0 0
1073790144 895
1 1107797840
1073774719 1073829932
70 1073830456
-1073751744 1073790467
1073830868 1073832832
1 0
1107383425 134513658
1108545272 1108544020
-1073751768 134513465
1108544020 1073792608
-1073751752 134514186
怎么是这样的一组数 , 甚是不解. |
|