大神,帮忙看看,让笑脸移动的程序!
#include<stdio.h>#include<windows.h>
#include<stdlib.h>
struct move_point
{
int x;
int y;
}gotoxy;
int i=20,j=40,end; char c;
int main(void)
{
HANDLE hout;
COORD gotoxy={20,40};
hout=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hout,FOREGROUND_RED);
for(end=0;;end++)
{
c=getchar();
system("cls");
switch(c)
{
case 'w':j=j+i;break;
case 'a':i=i-1;break;
case 's':j=j-1;break;
case 'd':i=i+1;break;
default: end=0;
}
gotoxy.x=i;gotoxy.y=j;
SetConsoleCursorPosition(hout, gotoxy);
printf("%c",2);
}
getchar();
return 0;
}
帮忙看一下啊
什么问题呢?
error C2039: 'x' : is not a member of '_COORD'
c:\program files (x86)\microsoft visual studio\vc98\include\wincon.h(29) : see declaration of '_COORD'