From: Zeyd M. Ben-Halim (zmbenhal@netcom.com)
Date: 08/17/93


From: zmbenhal@netcom.com (Zeyd M. Ben-Halim)
Subject: Re: Ncurses, how do I...
Date: Wed, 18 Aug 1993 02:39:26 GMT

In article <24rl0fINNbcr@uwm.edu> zak@csd4.csd.uwm.edu writes:
>> There s no kbhit(), you need to call cbreak() before you call getch() this
>> will return single keystrokes.
>
>Might anyone know why this little program puts the cursor on the 1st line
>when run?
>
>#include <curses.h>
>#include <stdio.h>
>main ()
> {
> initscr();
> crmode();
> printf("%c\n",getch());
> nocrmode();
> endwin();
> }

First of all this program shouldn't display anything as it doesn't have a
refresh(). Second, you shouldn't use stdio.h routines with curses. Use printw
instead of printf. The cursor always starts at the upperleft corner of the
screen. use move() if you want it somewhere else.

Zeyd

>.. Or how to prevent it?
>--
>Zak Smith zak@csd4.csd.uwm.edu
>414-966-3551 voice OS2 & LINUX