Way to input in console

hello, suppose you have this in console window:

+------------------------------------+
|                                    |
|                                    |
|                                    |
|                                    |
|                                    |
|                                    |
+------------------------------------+
|                                    |
+------------------------------------+

Is there a way (through some handles maybe) to make user input data (something like cin) in the bottom rectangle? Or maybe there is a way to control the position of cin? Thank you.
http://en.wikipedia.org/wiki/Ncurses
I think that library might help.

-Albatross
Yeah, this might work, but i don't want to dig too deeply in some libraries just for one function... I thought maybe there is a somehow standard way to do this... Well, i guess i'll just play around with getch a bit and figure it out manually...
Something tells me that you can't do this with the iostream library (though I might be wrong; I've never tried to do anything like this before).

There is, however, an excellent reference/tutorial for ncurses that can be found below this line.
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/index.html

-Albatross
Thank you, but never mind, i almost done it with _getch() and STD handle. Maybe other time I'll check that one out, but now, while i started with that handle, i think i'll finish with it :)
If you are doing windowing stuff, then use NCurses.

Alternately, you can use the Windows Console API to position the cursor before input. Make sure to sync() the standard streams first.
http://www.google.com/search?btnI=1&q=msdn+Console+Functions

Hope this helps.
I think he/she's using conio.h, which I guess would be for all practical purposes part of the Windows API.

What makes me think that: reference to getch().

-Albatross
Last edited on
However, in all his other threads he is using the Windows Console API functions...
Well, i actually did everything with _getch() and WriteConsoleCharacter(). With a little coding i now even can edit the input using backspace, so it's cool. Next time, though, i will use those NCurses.
Topic archived. No new replies allowed.