atoi(3) Library Functions Manual atoi(3) NOMBRE atoi, atol, atoll - convierten una cadena en un entero BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include int atoi(const char *nptr); long atol(const char *nptr); long long atoll(const char *nptr); Requisitos de Macros de Prueba de Caracteristicas para glibc (vease feature_test_macros(7)): atoll(): _ISOC99_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE DESCRIPCION La funcion atoi() convierte la porcion inicial de la cadena apuntada por nptr a int. El comportamiento es el mismo que strtol(nptr, NULL, 10); excepto que atoi() no detecta errores. Las funciones atol() y atoll() se comportan igual que atoi(), salvo que convierten la porcion inicial de la cadena a long y long long respectivamente. VALOR DEVUELTO The converted value or 0 on error. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +----------------+--------------------+-----------------------------------------------+ |Interfaz | Atributo | Valor | +----------------+--------------------+-----------------------------------------------+ |atoi(), atol(), | Seguridad del hilo | Configuracion regional de multi-hilo seguro | |atoll() | | | +----------------+--------------------+-----------------------------------------------+ VERSIONES POSIX.1 leaves the return value of atoi() on error unspecified. On glibc, musl libc, and uClibc, 0 is returned on error. ESTANDARES C11, POSIX.1-2008. HISTORIAL C99, POSIX.1-2001, SVr4, 4.3BSD. C89 and POSIX.1-1996 include the functions atoi() and atol() only. ERRORES errno is not set on error so there is no way to distinguish between 0 as an error and as the converted value. No checks for overflow or underflow are done. Only base-10 input can be converted. It is recommended to instead use the strtol() and strtoul() family of functions in new programs. VEASE TAMBIEN atof(3), strtod(3), strtol(3), strtoul(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Sebastian Desimone y 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 atoi(3)