<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 * ...
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="scanf">
    <refnamediv>
        <refname>scanf</refname>
        <refpurpose>converts formatted input on standard input</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>[v_1, ..., v_n] = scanf(format);</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>format</term>
                <listitem>
                    <para>a character string: specifies the format conversion.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>v_1, ..., v_n</term>
                <listitem>
                    <para>converted results.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            The <function>scanf</function> function gets character data on standard input (<code>%io(1)</code>), interprets it according
            to a <varname>format</varname>, and returns the converted results <varname>v_1</varname>, ..., <varname>v_n</varname>.
        </para>
        <para>
            The <varname>format</varname> parameter contains conversion specifications
            used to interpret the input.
        </para>
        <para>
            The <varname>format</varname> parameter can contain
            white-space characters (blanks, tabs, newline, or formfeed)
            that, except in the following two cases, read the input up to the
            next nonwhite-space character. Unless there is a match in the control
            string, trailing white-space (including a newline character) is not
            read.
        </para>
        <itemizedlist>
            <listitem>
                <para>
                    Any character except <literal>%</literal> (percent sign), which must match the next character of the input stream.
                </para>
            </listitem>
            <listitem>
                <para>
                    A conversion specification that directs the conversion of the next input field. See <link linkend="scanf_conversion">scanf_conversion</link> for details.
                </para>
            </listitem>
        </itemizedlist>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="read">read</link>
            </member>
            <member>
                <link linkend="mfscanf">mfscanf</link>
            </member>
            <member>
                <link linkend="scanf_conversion">scanf_conversion</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
