大虾们,帮忙看看。。。。名字的输出有错
#include<stdio.h>#include<graphics.h>
void hanzi_16(x,y,s,colour,height,width,distance,timelag,print_dir,time_style)
int x,y,colour,height,width,distance,timelag,print_dir,time_style;
char *s;
{
FILE *fp;
int t;
char buffer[32];
register m,n,i,j,k;
unsigned char qh,wh;
unsigned long location;
if((fp = fopen("hzk16","rb")) == NULL)
{
printf("Cant open hzk16!");
getch();
exit(0);
}
while(*s)
{
qh=*s-0xa0;
wh=*(s+1)-0xa0;
location=(94*(qh-1)+(wh-1))*32L;
fseek(fp,location,SEEK_SET);
fread(buffer,32,1,fp);
for(i = 0;i < 16;i++)
for(n = 0;n < height;n++)
for(j = 0;j < 2;j++)
for(k = 0;k < 8;k++)
for(m = 0;m < width;m++)
if(((buffer[i * 2 + j] >> (7 - k)) & 0x1) != NULL)
{
if(time_style == 1)
for(t = 0;t < timelag;t++)
delay(500);
putpixel(x + 8 * j * width + k * width + m,y + i * height + n,colour);
}
s += 2;
if(print_dir == 0)
x += distance;
else
y += distance;
if(time_style == 0)
for(t = 0;t < timelag;t++)
delay(50000);
}
fclose(fp);
}
main()
{
int gd = DETECT,gm;
initgraph(&gd,gm,"");
hanzi_16(200,160,"张三",YELLOW,1,1,20,0,0,0);
getch();
}