home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC1.ZIP / CSCANF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.9 KB  |  61 lines

  1. /*------------------------------------------------------------------------
  2.  * filename - cscanf.c
  3.  *
  4.  * function(s)
  5.  *        cscanf - performs formatted input from console
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <conio.h>
  18. #include <stdio.h>
  19. #include <_stdio.h>
  20. #include <_scanf.h>
  21.  
  22.  
  23. /*--------------------------------------------------------------------------*
  24.  
  25. Name            cscanf - performs formatted input from console
  26.  
  27. Usage           int cscanf(char *format[,argument, ...]);
  28.  
  29. Prototype in    conio.h
  30.  
  31. Description     cscanf,  as  all  ...scanf  family  functions,  scans input
  32.                 fields,  one  character  at   a  time,  and  converts  them
  33.                 according to a given format; these functions all:
  34.  
  35.                 . accept  a format  string  that  determines how  the input
  36.                 fields are  to be interpreted.
  37.  
  38.                 . apply  the format  string to  a variable  number of input
  39.                 fields in order to format the input
  40.  
  41.                 . store  the  formatted  input  in  the  addresses given as
  42.                 arguments  after  the  format  string.
  43.  
  44.  
  45. Return value    cscanf  returns  the  number  of  input fields successfully
  46.                 scanned, converted  and stored. If cscanf  attempts to read
  47.                 an end-of-file, the return value  is EOF. If no fields were
  48.                 stored, the return value is 0.
  49.  
  50. *---------------------------------------------------------------------------*/
  51. int cdecl cscanf (const char *fmt, ...)
  52. {
  53.         return  _scanner (
  54.                 (int near (*)(void *))_Ngetche,
  55.                 (void near (*)(int, void *))_Nungetch,
  56.                 NULL,
  57.                 fmt,
  58.                 _va_ptr
  59.                 );
  60. }
  61.