home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - getw.c
- *
- * function(s)
- * getw - gets a word from a stream
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
- #include <stdio.h>
-
- /*---------------------------------------------------------------------*
-
- Name getw - gets a word from a stream
-
- Usage #include <stdio.h>
- int getw(FILE * stream);
-
- Prototype in stdio.h
-
- Description see getc
-
- *---------------------------------------------------------------------*/
- int getw(FILE *fp)
- {
- int c, res;
-
- if ((c = getc(fp)) != EOF)
- if ((res = getc(fp)) == EOF)
- c = EOF;
- else
- (*((char *)&(c) + 1)) = res;
-
- return(c);
- }
-