home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / CSCANF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  2.1 KB  |  62 lines

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