|
-
Jan 20th, 2003, 06:17 PM
#1
Thread Starter
Addicted Member
gotoxy() without changing y
how can I move the X position with gotoxy() without changing the Y position?
To understand recursion, one must first understand the concept of recursion.
-
Jan 20th, 2003, 07:53 PM
#2
PowerPoster
-
Jan 20th, 2003, 08:32 PM
#3
Thread Starter
Addicted Member
the X position where cout prints stuff..
To understand recursion, one must first understand the concept of recursion.
-
Jan 20th, 2003, 09:05 PM
#4
Stuck in the 80s
I wrote this code last semester at school because I didn't dig how setw() managed things:
Code:
#include <windows.h>
//function to move the cursor x spaces horizontally:
void SetXPos(int x) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
COORD coord;
GetConsoleScreenBufferInfo(hConsole, &csbiInfo);
coord.X = x;
coord.Y = csbiInfo.dwCursorPosition.Y;
SetConsoleCursorPosition(hConsole, coord);
}
Hope this helps.
-
Jan 21st, 2003, 11:38 AM
#5
gotoxy is Borland-specific. I hope you know that.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 21st, 2003, 04:09 PM
#6
Stuck in the 80s
But it can be recreated easily:
Code:
void gotoxy(int x, int y) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(hConsole, coord);
}
-
Jan 21st, 2003, 04:33 PM
#7
Thread Starter
Addicted Member
hmm, so is conio.h borland specific or something?
To understand recursion, one must first understand the concept of recursion.
-
Jan 22nd, 2003, 05:41 AM
#8
No, not really. Nearly every compiler has conio.h. But the contents are not standardized and vary greatly from compiler to compiler.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 22nd, 2003, 06:14 AM
#9
Monday Morning Lunatic
The "standard" way of doing this is with ncurses, but I don't know if there's a Windows port of it. Take a look
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|