DeAI Research
Source · man

snprintf(3) - Linux manual page

2001

cid 923f82f1efcb7368322c9380b0778d756fc206b12510ae2e9f56976bea62dce6 · original · open access · via man

Title: snprintf(3) - Linux manual page
Authors: 
Venue: man
Year: 2001
Canonical: man:man3/snprintf.3
URL: https://man7.org/linux/man-pages/man3/snprintf.3.html
Collector: man
OA: true

ABSTRACT
snprintf(3) - Linux manual page man7.org Linux man-pages Linux/UNIX system programming training snprintf(3) — Linux manual page NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | STANDARDS | HISTORY | CAVEATS | BUGS | EXAMPLES | SEE ALSO | COLOPHON snprintf(3) Library Functions Manual snprintf(3) NAME top snprintf, vsnprintf - string print formatted LIBRARY top Standard C library (libc, -lc) SYNOPSIS top #include int snprintf(size_t size; char str[restrict size], size_t size, const char *restrict format, ...); int vsnprintf(size_t size; char str[restrict size], size_t size, const char *restrict format, va_list ap); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): snprintf(), vsnprintf(): _XOPEN_SOURCE = 500 || _ISOC99_SOURCE || /* glibc #include #include char * make_message(const char *fmt, ...) { int n = 0; size_t size = 0; char *p = NULL; va_list ap; /* Determine required size. */ va_start(ap, fmt); n = vsnprintf(p, size, fmt, ap); va_end(ap); if (n