asprintf(3) Library Functions Manual asprintf(3) NOMBRE asprintf, vasprintf - imprimen en una cadena reservada BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #define _GNU_SOURCE /* Vea feature_test_macros(7) */ #include int asprintf(char **restrict strp, const char *restrict fmt, ...); int vasprintf(char **restrict strp, const char *restrict fmt, va_list ap); DESCRIPCION The functions asprintf() and vasprintf() are analogs of sprintf(3) and vsprintf(3), except that they allocate a string large enough to hold the output including the terminating null byte ('\0'), and return a pointer to it via the first argument. This pointer should be passed to free(3) to release the allocated storage when it is no longer needed. VALOR DEVUELTO Cuando tienen exito, estas funciones devuelven el numero de bytes impresos, al igual que sprintf(3). Si la reserva de memoria no se pudo llevar a cabo, o ocurre algun otro error, estas funciones devuelven -1, y el contenido de strp queda indefinido. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +------------+--------------------+-----------------------------------------------+ |Interfaz | Atributo | Valor | +------------+--------------------+-----------------------------------------------+ |asprintf(), | Seguridad del hilo | Configuracion regional de multi-hilo seguro | |vasprintf() | | | +------------+--------------------+-----------------------------------------------+ VERSIONES The FreeBSD implementation sets strp to NULL on error. ESTANDARES GNU, BSD. VEASE TAMBIEN free(3), malloc(3), printf(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Miguel Perez Ibars Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Paginas de manual de Linux 6.06 31 Octubre 2023 asprintf(3)