GNU Info

Info Node: (gmp.info)Formatted Input Functions

(gmp.info)Formatted Input Functions


Next: C++ Formatted Input Prev: Formatted Input Strings Up: Formatted Input
Enter node , (file) or (file)node

Formatted Input Functions
=========================

   Each of the following functions is similar to the corresponding C
library function.  The plain `scanf' forms take a variable argument
list.  The `vscanf' forms take an argument pointer, see Note: Variadic
Functions, or `man 3 va_start'.

   It should be emphasised that if a format string is invalid, or the
arguments don't match what the format specifies, then the behaviour of
any of these functions will be unpredictable.  GCC format string
checking is not available, since it doesn't recognise the GMP
extensions.

   No overlap is permitted between the FMT string and any of the results
produced.

 - Function: int gmp_scanf (const char *FMT, ...)
 - Function: int gmp_vscanf (const char *FMT, va_list AP)
     Read from the standard input `stdin'.

 - Function: int gmp_fscanf (FILE *FP, const char *FMT, ...)
 - Function: int gmp_vfscanf (FILE *FP, const char *FMT, va_list AP)
     Read from the stream FP.

 - Function: int gmp_sscanf (const char *S, const char *FMT, ...)
 - Function: int gmp_vsscanf (const char *S, const char *FMT, va_list
          AP)
     Read from a null-terminated string S.

   The return value from each of these functions is the same as the
standard C99 `scanf', namely the number of fields successfully parsed
and stored.  `%n' fields and fields read but suppressed by `*' don't
count towards the return value.

   If end of file or file error, or end of string, is reached when a
match is required, and when no previous non-suppressed fields have
matched, then the return value is EOF instead of 0.  A match is
required for a literal character in the format string or a field other
than `%n'.  Whitespace in the format string is only an optional match
and won't induce an EOF in this fashion.  Leading whitespace read and
discarded for a field doesn't count as a match.


automatically generated by info2www version 1.2.2.9