GNU Info

Info Node: (libc.info)Formatted Input Functions

(libc.info)Formatted Input Functions


Next: Variable Arguments Input Prev: Other Input Conversions Up: Formatted Input
Enter node , (file) or (file)node

Formatted Input Functions
-------------------------

   Here are the descriptions of the functions for performing formatted
input.  Prototypes for these functions are in the header file `stdio.h'.

 - Function: int scanf (const char *TEMPLATE, ...)
     The `scanf' function reads formatted input from the stream `stdin'
     under the control of the template string TEMPLATE.  The optional
     arguments are pointers to the places which receive the resulting
     values.

     The return value is normally the number of successful assignments.
     If an end-of-file condition is detected before any matches are
     performed, including matches against whitespace and literal
     characters in the template, then `EOF' is returned.

 - Function: int wscanf (const wchar_t *TEMPLATE, ...)
     The `wscanf' function reads formatted input from the stream
     `stdin' under the control of the template string TEMPLATE.  The
     optional arguments are pointers to the places which receive the
     resulting values.

     The return value is normally the number of successful assignments.
     If an end-of-file condition is detected before any matches are
     performed, including matches against whitespace and literal
     characters in the template, then `WEOF' is returned.

 - Function: int fscanf (FILE *STREAM, const char *TEMPLATE, ...)
     This function is just like `scanf', except that the input is read
     from the stream STREAM instead of `stdin'.

 - Function: int fwscanf (FILE *STREAM, const wchar_t *TEMPLATE, ...)
     This function is just like `wscanf', except that the input is read
     from the stream STREAM instead of `stdin'.

 - Function: int sscanf (const char *S, const char *TEMPLATE, ...)
     This is like `scanf', except that the characters are taken from the
     null-terminated string S instead of from a stream.  Reaching the
     end of the string is treated as an end-of-file condition.

     The behavior of this function is undefined if copying takes place
     between objects that overlap--for example, if S is also given as
     an argument to receive a string read under control of the `%s',
     `%S', or `%[' conversion.

 - Function: int swscanf (const wchar_t *WS, const char *TEMPLATE, ...)
     This is like `wscanf', except that the characters are taken from
     the null-terminated string WS instead of from a stream.  Reaching
     the end of the string is treated as an end-of-file condition.

     The behavior of this function is undefined if copying takes place
     between objects that overlap--for example, if WS is also given as
     an argument to receive a string read under control of the `%s',
     `%S', or `%[' conversion.


automatically generated by info2www version 1.2.2.9