Sign in to follow this  
backbone

gotoxy())

Recommended Posts

okay, here's the problem... i found on the net code for c++ that moves the console cursor on a wanted location, it should be the same as gotoxy(x,y) function in old pascal;) but it isn't .. murphys laws doh!;) i remember in pascal.. i wrote gotoxy(x,y) and after that outputed some text on screen, then i would again use gotoxy(x,y) to go on some other location on the screen, and outputed some more text over there.. now that code that i have found doesn't behave much like this .. example gotoxy(5,5); cout<< "blah"; gotoxy(1,25); cout << "Yeah!"; and after that the output is like i had wrote gotoxy(1,25); cout<< "blah"; cout << "Yeah!"; i hope that i have cleared what bugz me;) i am working on some kind of a console game;) something like pacman;) hehh;) i am using visual c++ 6.0 this is the gotoxy(int x,int y) function void gotoxy(int x, int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } I am a old fashioned guy, and i don't know about windows programming, handles and stuff, this was easy to do in pascal, but here... huh;) .. thank you very much .. gado... ;)

Share this post


Link to post
Share on other sites
cout buffers. if you did a << flush right afterword it'd probably look liek you want.

otherwise, since you're using window specific console functions, I think there's TextOut or something in that api, too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this