DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Simple input and output

scanw

SYNOPSIS

   #include <ocurses.h>
   

int scanw(fmt [, arg...]) char *fmt;

NOTES

EXAMPLE

   #include <ocurses.h>
   

main() { char string[100]; float number;

initscr(); cbreak(); /* Explained later in the */ echo(); /* section "Input Options" */ addstr("Enter a number and a string separated by a comma: "); refresh(); scanw("%f,%s",&number,string); clear(); printw("The string was \"%s\" and the number was %f. ", string,number); refresh(); endwin(); }

Notice the two calls to refresh. The first call updates the screen with the character string passed to addstr, the second with the string returned from scanw. Also notice the call to clear. Assume you entered the following when prompted: 2,twin. After running this program, your terminal screen would appear as follows:

   The string was "twin" and the number was 2.000000.
   

$[]


Next topic: Output attributes
Previous topic: getstr

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004