Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - English


scanf

converts formatted input on standard input

Syntax

[v_1, ..., v_n] = scanf(format);

Arguments

format

a character string: specifies the format conversion.

v_1, ..., v_n

converted results.

Description

The scanf function gets character data on standard input (%io(1)), interprets it according to a format, and returns the converted results v_1, ..., v_n.

The format parameter contains conversion specifications used to interpret the input.

The format 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.

  • Any character except % (percent sign), which must match the next character of the input stream.

  • A conversion specification that directs the conversion of the next input field. See scanf_conversion for details.

See also

  • read — matrices read
  • mfscanf — reads input from the stream pointer stream (interface to the C fscanf function)
  • scanf_conversion — mscanf, msscanf, mfscanf conversion specifications
Report an issue
<< save format Files : Input/Output functions scanf_conversion >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 24 11:13:09 CEST 2024