Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int sscanf( const char *in_string,
                const char *format, ... );
    #include <wchar.h>
    int swscanf( const wchar_t *in_string,
                 const wchar_t *format, ... );

Description:
    The sscanf function scans input from the character string in_string
    under control of the argument format.  Following the format string is
    the list of addresses of items to receive values.

    The format string is described under the description of the  scanf
    function.

    The swscanf function is identical to sscanf except that it accepts a
    wide-character string argument for format and the input string in_string
    consists of wide characters.

Returns:
    The sscanf function returns  EOF when the scanning is terminated by
    reaching the end of the input string.  Otherwise, the number of input
    arguments for which values were successfully scanned and stored is
    returned.

Example:
    #include <stdio.h>

    /* Scan a date in the form "Saturday April 18 1987" */

    void main()
      {
        int day, year;
        char weekday[20], month[20];

        sscanf( "Friday August 0014 1987",
                "%s %s %d  %d",
                 weekday, month, &day, &year );
        printf( "%s %s %d %d\n",
                 weekday, month, day, year );
      }

    produces the following:

    Friday August 14 1987

Classification:
    sscanf is ANSI, swscanf is ANSI

Systems:
     sscanf - All, Netware

    swscanf - All

See Also:
    cscanf, fscanf, scanf, vcscanf, vfscanf, vscanf, vsscanf

See Also: cscanf vcscanf

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson