Provided by: manpages-es-dev_4.27.0-1_all bug

NOMBRE

       atoi, atol, atoll - convierten una cadena en un entero

BIBLIOTECA

       Biblioteca Estándar C (libc, -lc)

SINOPSIS

       #include <stdlib.h>

       int atoi(const char *nptr);
       long atol(const char *nptr);
       long long atoll(const char *nptr);

   Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

       atoll():
           _ISOC99_SOURCE
               || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE

DESCRIPCIÓN

       La función atoi() convierte la porción 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 porción inicial de
       la cadena a long y long long respectivamente.

VALOR DEVUELTO

       The converted value or 0 on error.

ATRIBUTOS

       Para obtener una explicación de los términos usados en esta sección, véase attributes(7).
       ┌────────────────────────────────────┬────────────────────┬─────────────────────────────────────────────┐
       │ InterfazAtributoValor                                       │
       ├────────────────────────────────────┼────────────────────┼─────────────────────────────────────────────┤
       │ atoi(), atol(), atoll()            │ Seguridad del hilo │ Configuración regional de multi-hilo seguro │
       └────────────────────────────────────┴────────────────────┴─────────────────────────────────────────────┘

VERSIONES

       POSIX.1 leaves the return value of atoi()  on error unspecified.  On glibc, musl libc, and uClibc,  0  is
       returned on error.

ESTÁNDARES

       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.

VÉASE TAMBIÉN

       atof(3), strtod(3), strtol(3), strtoul(3)

TRADUCCIÓN

       La   traducción   al   español   de   esta   página   del   manual  fue  creada  por  Sebastian  Desimone
       <chipy@argenet.com.ar> y Miguel Pérez Ibars <mpi79470@alu.um.es>

       Esta traducción es documentación libre;  lea  la  GNU General Public License Version 3  o  posterior  con
       respecto a las condiciones de copyright.  No existe NINGUNA RESPONSABILIDAD.

       Si  encuentra  algún  error  en  la  traducción  de esta página del manual, envíe un correo electrónico a
       debian-l10n-spanish@lists.debian.org.

Páginas de Manual de Linux 6.9.1                   2 Mayo 2024                                           atoi(3)