Type mismatch in redeclaration of "myprintf! 求解答!
以下函数(在 DOSbox BorlandC 3,0中) 结果 显示 “Type mismatch in redeclaration of "myprintf"” ,怎么解决啊?#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
#include <dos.h>
#include <bios.h>
#define HZKLOD "f:\\hzk16"
#define BGILOD "e:\\TCPP30H\\bgi"
#define ASCLOD "f:\\asc16"
/*******数据结构**********/
/****鼠标函数******/
void mousestr()
{
union REGS in;
in.x.ax=0;
int86(0x33,&in,&in);
if(in.x.ax==0)
myprintf(40,200,"鼠标初始化错误!",RED);
}
void mouseappear()
{
union REGS in;
in.x.ax=1;
int86(0x33,&in,&in);
}
void mousehide()
{union REGS in;
in.x.ax=2;
it86(0x33,&in,&in);
}
void mousepos(int *x,int *y,int *m)
{
union REGS in;
in.x.ax=3;
int86(0x33,&in,&in);
x=in.x.cx;
y=in.x.dx;
m=in.x.bx;
}
void setmoupos(int x,int y)
{
union REGS in;
in.x.cx=x;
in.x.dx=y;
int86(0x33,&in,&in);
}
void setmosxarea(int minx,int maxx)
{
union REGS in;
in.x.cx=minx;
in.x.dx=maxx;
in.a.ax=7;
int86(0x33,&in,&in);
}
void setmosyarea(int miny,int maxy)
{
union REGS in;
in.x.cx=miny;
in.x.dx=maxy;
int86(0x33,&in,&in);
}
int checkmouarea(in x1,int y1,int x2,int y2)
{
int x,y,i;
mousepos(&x,&y,&i);
if(x<x1||x>x2||y<y1||y>y2) return 0;
else if(!i) return 1;
else return 2;
}
/*****自定义输出函数****/
void graphini()
{
int gd=DETECT,gm;
registerbgidriver(EGAVGA_driver);
initgraph(&gd,&gm,BGILOD);
}
void myprintf(int x,int y,char *m,int color)
{
FILE *fp,*fpa;
int i,j,k;
long int fpos; /*具体字在字库中的偏移量*/
if((fp=fopen(HZKLOD,"rb"))==NULL) /*打开16*16点阵汉字字库*/
{
printf("Cannot open hzk16!press any key to quit!");
getch();
exit(0);}
if((fpa=fopen(ASCLOD,"rb"))==NULL) /*打开16*16点阵英文字库*/
{
printf("Can't open asc16 !press any key to quit!");
getch();
exit(0);
}
for(i=0;*(m+i)!='\0';i++)
{
if(*(m+i)<0)
{
unsigned char qh,wh,bitdata[32],bit[8]={128,64,32,16,8,4,2,1};
int k,j;
qh=*(m+i)-0xa0; /*汉字区位码*/
wh=*(m+i+1)-0xa0;
fpos=(94*(qh-1)+(wh-1))*32L ; /*获得字模在字库中的位置*/
fseek(fp,fpos,SEEK_SET);
fread(bitdata,32,1,fp); /*把该汉字字模读入到bitdata中*/
for(k=0;k<16;k++)
for(j=0;j<8;j++) /*和bit[]与操作以后,在屏幕上画点*/
{
if(bitdata[2*k]&bit[j]) putpixel(x+j,k+y,color);
if(bitdata[2*k+1]&bit[j]) putpixel(x+8+j,k+y,color);
}
i++;
x+=16;
}
else
{ char buffera[16];
fpos=(*(m+i))*16;
fseek(fpa,fpos,SEEK_SET); /*****查找英文字符在ASC16文件中的位置******/
fread(buffera,1,16,fpa); /****读取英文字符在ASC16文件中的字段*******/
for(k=0;k<16;k++)
for(j=0;j<8;j++)
if(((buffera[k]>>(7-j))&0x1)!=NULL)
putpixel(j+x,k+y,color); /**如果该位非空,则画点***********/
x+=8; /******屏幕光标偏移量***********************/
}
if(x>=getmaxx())
{ y+=16;
x=0; }
}
fclose(fp); /*********关闭文件指针*********/
fclose(fpa); /*********关闭文件指针*********/
}/******欢迎界面函数***********/
void welcome()
{
/*****暂未开发******/
}
/*****************功能函数****************/
void jiemian()
{
setbkcolor(7);
setcolor(WHITE);
rectangle(5,5,634,474);
line(5,24,639,24);
}
void function()
{
jiemian();
}
/*****************退出函数****************/
void thinkused()
{
}
/*****************主函数*****************/
void main()
{
graphini();
welcome();/******欢迎界面*******/
function();/******功能函数****/
thinkused();
closegraph();
}