1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\" Linux libc source code
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Sun Jul 25 10:54:03 1993 by Rik Faith (faith@cs.unc.edu)
.\" Fixed typo, aeb , 950823
.\"
.TH STRTOUL 3 "29 de Marzo de 1993" "GNU" "Manual del Programador de Linux"
.SH NOMBRE
strtoul \- convierte una cadena en un entero largo sin signo.
.SH SINOPSIS
.nf
.B #include <stdlib.h>
.sp
.BI "unsigned long int strtoul(const char *" nptr ", char **" endptr ,
.BR int " base" )
.fi
.SH DESCRIPCIN
La funcin \fBstrtoul()\fP convierte la cadena \fInptr\fP en un valor entero largo
sin signo de acuerdo con la \fIbase\fP dada, la cual debe estar entre 2 y 36
inclusive, o ser el valor especial 0.
.PP
La cadena debe comenzar con una cantidad arbitraria de espacios en blanco
(determinado por
.BR isspace (3))
y seguida por un opcional y nico signo `+' o `-'.
Si \fIbase\fP es cero o 16, la cadena puede entonces incluir un prefijo
`0x' , y el nmero se leer en base 16; en caso contrario, una \fIbase\fP
cero se toma como 10 (decimal) a menos que el siguiente caracter sea `0',
en cuyo caso se toma como 8 (octal).
.PP
El resto de la cadena se convierte en un valor entero largo sin signo de la
manera obvia, detenindose en el primer caracter que no sea un dgito vlido
en la base dadd. (En bases por encima de 10, la letra `A' mayscula o
minscula representa 10, `B' representa 11, y as en adelante, con `Z'
representando 35).
.PP
Si \fIendptr\fP no es NULL, \fBstrtoul()\fP almacena la direccin del primer
caracter no vlido en \fI*endptr\fP. Si no hubiera dgitos en absoluto
\fBstrtoul()\fP almacena el valor original de \fInptr\fP en \fI*endptr\fP.
(Por tanto, si \fI*nptr\fP no es `\\0' pero \fI**endptr\fP es `\\0' al
retornar, toda la cadena es vlida).
.SH "VALOR DEVUELTO"
La funcin \fBstrtoul()\fP devuelve o el resultado de la conversin o, si
hubiera un signo menos delante, la negacin del resultado de la conversin,
a menos que el valor original (no-negado) se hubiera sobrepasado; en tal
caso, \fBstrtoul()\fP devuelve ULONG_MAX y asigna ERANGE a la variable global
\fIerrno\fP.
.SH "ERRORES"
.TP
.B ERANGE
La cadena dada estaba fuera de rango; el valor convertido se ha restringido.
.SH "CONFORME A"
SVID 3, BSD 4.3, ISO 9899
.SH "VASE TAMBIN"
.BR atof "(3), " atoi "(3), " atol "(3), " strtod "(3), " strtol (3)
.SH FALLOS
Ignora la localizacin actual.
|