Next: iscanf, Previous: scanf, Up: Stdio

### 4.47 `iprintf`, `fiprintf`, `asiprintf`, `siprintf`, `sniprintf`—format output

Synopsis

         #include <stdio.h>

         int iprintf(const char *format [, arg, ...]);
         int fiprintf(FILE *fd, const char *format [, arg, ...]);
         int siprintf(char *str, const char *format [, arg, ...]);
         int asiprintf(char **strp, const char *format [, arg, ...]);
         int sniprintf(char *str, size_t size, const char *format
             [, arg, ...]);

Description
`iprintf`, `fiprintf`, `siprintf`, `sniprintf`, `asiprintf`, are the same as `printf`, `fprintf`, `sprintf`, `snprintf`, and `asprintf`, respectively, only that they restrict usage to non-floating-point format specifiers.

Returns
`siprintf` and `asiprintf` return the number of bytes in the output string, save that the concluding `NULL` is not counted. `iprintf` and `fiprintf` return the number of characters transmitted. If an error occurs, `iprintf` and `fiprintf` return `EOF` and `asiprintf` returns -1. No error returns occur for `siprintf`.

Portability
`iprintf`, `fiprintf`, `siprintf`, `sniprintf`, and `asprintf` are newlib extensions.

Supporting OS subroutines required: `close`, `fstat`, `isatty`, `lseek`, `read`, `sbrk`, `write`.