[求助]带字库点阵显示汉字
我想学如何在DOS下显示汉字,最近在网上找到了一个例子,不但看得有点吃力,运行还出错.求哪位大侠帮看一下.以下显红色的是我的问题以疑惑之处.
#include<stdio.h>
#include<graphics.h>
void hanzi16(int x,int y,char *s,int colour)
{
FILE *fp;
char buffer[32];
register i,j,k;
unsigned char qh,wh;/*代表什么,看不懂啊*/
unsigned long location;
if((fp=fopen("hzk16","rb"))==NULL)
{
printf("can't open hzk16");
getch();
exit(0);
}
while(*s)
{
qh=*s-0xa0;
wh=*(s+1)-0xa0;
location=(94*(qh-1)+(wh-1))*32L;/*qh=*s-0xa0是什么意思?wh=*(s+1)-0xa0又是什么?location是要算什么的*/
fseed(fp,location,SEEK_SET);
freed(buffer,32,1,fp);
for(i=0;i<16;i++)
for(j=0;j<2;j++)
for(k=0;k<8;k++)
if(((buffer[i*2+j]>>(7-k))&0x1)!=NULL)
putpixel(x+8*j+k,y+I,colour);
s+=2;
x+=16;
}
fclose(fp);
}
main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
hanzi16(246,200,"续创中山",BROWN);
getch();
closegraph();
}