gotoxy())

Started by
2 comments, last by backbone 19 years, 7 months ago
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... ;)
(2B)||(!2B)
Advertisement
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.
or u can use printf() or WriteConsole()
--------------------Ad Astra Per Aspera--------------------
okay, i found the answer, acctually Colin Jeanne from www.cpp-home.com 's forums helped me.. i needed to add "<< flush;" to my cout lines to make shure that they have printed..
thanks anyway;)
(2B)||(!2B)

This topic is closed to new replies.

Advertisement