Archived

This topic is now archived and is closed to further replies.

bluestrattos

move a "O"

Recommended Posts

Hello i have this code in TC
#include <stdio.h>
#include <conio.h>
#define ESC 27
#define ENTER 13
#define HOME 71
#define END 79
#define L_KEY 75
#define R_KEY 77
#define U_KEY 72
#define D_KEY 80

struct pos{
	int x, y;
}coord;

void main(void){
	char c;
	coord.x=coord.y=1;
	_setcursortype(_NOCURSOR);
	do{
		c=getch();
		clrscr();
		switch(c){
			case L_KEY: coord.x--; break;
			case R_KEY: coord.x++; break;
			case U_KEY: coord.y--; break;
			case D_KEY: coord.y++; break;
		}
		gotoxy(coord.x,coord.y);
		printf("O");
	}while(c!=ESC);
} 
How can i do the that but in win32 code? Thanx

Share this post


Link to post
Share on other sites