主题:请教这个程序输出怎么是乱码?
在图形模式下 想在(20 20)这个位置输出坐标(20,20)怎么输出的是乱码,麻烦那位高人指点下。P和0显示是好的 但20,20就是乱码了??
#include"graphics.h"
main()
{
int gdriver,gmode,x=20,y=20;
char msg[30];
gdriver=DETECT;
initgraph(&gdriver,&gmode,"");
setcolor(4);
sprintf(msg,"%s%d%d,%d","P",0,20,20);
outtextxy(20,20,msg);
getch();
closegraph();
}
#include"graphics.h"
main()
{
int gdriver,gmode,x=20,y=20;
char msg[30];
gdriver=DETECT;
initgraph(&gdriver,&gmode,"");
setcolor(4);
sprintf(msg,"%s%d%d,%d","P",0,20,20);
outtextxy(20,20,msg);
getch();
closegraph();
}