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

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Files : Input/Output functions > scanf_conversion


mscanf, msscanf, mfscanf conversion specifications


Each conversion specification in the format parameter contains the following elements:

  • the character % (percent sign);

  • the optional assignment suppression character * (asterisk);

  • an optional numeric maximum field width;

  • a conversion code.

The conversion specification has the following syntax:


The results from the conversion are placed in v_i arguments unless you specify assignment suppression with * (asterisk). Assignment suppression provides a way to describe an input field that is to be skipped. The input field is a string of nonwhite-space characters. It extends to the next inappropriate character or until the field width, if specified, is exhausted.

The conversion code indicates how to interpret the input field. You should not specify the v_i parameter for a suppressed field. You can use the following conversion codes:


accepts a single % (percent sign) input at this point; no assignment is done.

d, i

accepts a decimal integer.


accepts an unsigned decimal integer.


accepts an octal integer.


accepts a hexadecimal integer.

e, f, g

accepts a floating-point number. The next field is converted accordingly and stored through the corresponding parameter, which should be a pointer to a float. The input format for floating-point numbers is a string of digits, with the following optional characteristics:

  • it can be a signed value;

  • it can be an exponential value, containing a decimal point followed by an exponent field, which consists of an E or an e followed by an (optionally signed) integer;

  • it can be one of the special values %inf, %nan;


accepts a string of characters.


character value is expected. The normal skip over white-space is suppressed.


gets value as a double.

See Also

Report an issue
<< scanf Files : Input/Output functions Input/Output functions >>

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:
Wed Apr 01 10:13:56 CEST 2015