home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!gatech!concert!uvaarpa!murdoch!sphinx.phys.Virginia.EDU!bryan
- From: bryan@sphinx.phys.Virginia.EDU (bryan wright)
- Subject: Curses question: printf after initscr
- Message-ID: <1993Jan9.223815.22617@murdoch.acc.Virginia.EDU>
- Sender: usenet@murdoch.acc.Virginia.EDU
- Organization: University of Virginia
- Date: Sat, 9 Jan 1993 22:38:15 GMT
- Lines: 36
-
- Hi folks,
- This may be a FAQ, but it doesn't seem to be frequently answered:
-
- Why does the following program wait for a carriage return before sending
- the text "hello there" to the screen? (OS is Ultrix 4.0 on a DS3100.)
-
- #include <stdio.h>
- #include <cursesX.h>
- main()
- {
- char string[BUFSIZ];
-
- initscr();
- endwin();
- printf ("hello there");
- gets ( string );
-
- }
-
- This comes up because I'd like to write a curses interface for an existing
- application. Ideally, I'd call initscr at startup, then switch between
- curses and plain text by using 'refresh' and 'endwin'. Unfortunately, once
- I've called initscr I have to explicitly flush stdout whenever I use printf
- thereafter. I'd hate to have to rewrite all the I/O in terms of curses
- routines.
-
- Is there something simple I'm missing? Any advice would be
- appreciated.
-
- Thanks in advance,
- Bryan
- --
- ===============================================================================
- Bryan Wright |"If you take cranberries and stew them like
- Physics Department | applesauce, they taste much more like prunes
- University of Virginia | than rhubarb does." -- Groucho
-