[Scilab-users] mprintf("%c") actual action, and vs mprintf("%s") ?

Samuel Gougeon sgougeon at free.fr
Sun Jan 31 07:30:46 CET 2021


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210131/55b9360e/attachment.htm>


More information about the users mailing list