Print a variable-content message
int_T ssPrintf(const char_T *msg, ...)
msg
Message. Must be a ANSI®[1]
C printf
-style character vector with
optional variable replacement parameters.
...
Optional replacement arguments.
A positive value indicating the number of bytes transmitted. Returns a negative number indicating an error.
Prints a variable-content msg
. This macro expands to
mexPrintf
when the S-function is compiled via
mex
for use in a Simulink® simulation. When the S-function is compiled for use with the
Simulink
Coder™ code generation, this macro expands to printf
if
the target has stdio
facilities; otherwise, it becomes a call to
an empty function (rtPrintfNoOp
). In the case of code generation,
you can avoid a call altogether, using the SS_STDIO_AVAILABLE
macro defined by simstruc.h
. For example:
#if defined(SS_STDIO_AVAILABLE) ssPrintf("my message ..."); #endif
C, C++
See the S-function sfun_atol.c
used in sfcndemo_sfun_atol
.
[1] ANSI is a registered trademark of the American National Standards Institute, Inc.