Le 21/10/2020 à 20:12, Samuel Gougeon a écrit :

Hello,

The printf_conversion page <https://help.scilab.org/docs/6.1.0/en_US/printf_conversion.html> tells that the "/"%c" directive accepts and displays an integer value converted to a character"/.
Yet, with Scilab 6.1.0

--> msprintf("AB %c\n", 3)
msprintf: Wrong number of input arguments: data doesn't fit with format.

--> mprintf("AB %c\n", "5")
AB 5

--> mprintf("AB %c\n", "R")
AB R

--> mprintf("AB %c\n", "RB")
AB RB

So, what's the difference between the %c and %s printing formats?

In C language, *%c expects an **ascii code* and converts it into the corresponding character.
But Scilab' implementation of this format does not match C's one.
This is reported as bug 16564 <http://bugzilla.scilab.org/16564>. At least, Scilab's printf_conversion page could be more accurate.

Samuel


_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to