ungetch man page on Xenix

Man page or keyword search:  
man Server   1130 pages
apropos Keyword Search (all sections)
Output format
Xenix logo
[printable version]



     UNGETCH(DOS)	      XENIX System V		  UNGETCH(DOS)

     Name
	  ungetch - Returns a character to the console buffer.

     Syntax
	  #include <conio.h>

	  int ungetch (c);
	  int c;

     Description
	  The ungetch function pushes the character c back to the
	  console, causing c to be the next character read.  ungetch
	  fails if it is called more than once before the next read.

     Return Value
	  ungetch returns the character c if it is successful.	A
	  return value of EOF indicates an error.

     See Also
	  cscanf(DOS), getch(DOS), getche(DOS)

     Example
	  #include <conio.h> #include <ctype.h>

	  char buffer[100]; int count = 0; int ch;

	  /* The following code gets a token, delimited by blanks **
	  newlines, from the keyboard.	*/

	  ch = getche ( );

	  while (isspace (ch))	       /* skip preceding white space
	  */	   ch = getche ( );

	  while (count < 99) {	      /* gather token */
		   if (isspace (ch))   /* end of token */
	  break;

		buffer[count++] = ch;	    ch = getche ( );	   }

	  ungetch (ch);		       /* put back delimiter */
	  buffer[count] = '\0';	      /* null terminate the token */

     Notes
	  This call must be compiled with the -dos flag.

     Page 1					      (printed 8/7/87)

[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Xenix

List of man pages available for Xenix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net