.\" 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 .sp .BI "unsigned long int strtoul(const char *" nptr ", char **" endptr , .BR int " base" ) .fi .SH DESCRIPCIÓN La función \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 número 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, deteniéndose en el primer caracter que no sea un dígito válido en la base dadd. (En bases por encima de 10, la letra `A' mayúscula o minúscula representa 10, `B' representa 11, y así en adelante, con `Z' representando 35). .PP Si \fIendptr\fP no es NULL, \fBstrtoul()\fP almacena la dirección del primer caracter no válido en \fI*endptr\fP. Si no hubiera dígitos 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 válida). .SH "VALOR DEVUELTO" La función \fBstrtoul()\fP devuelve o el resultado de la conversión o, si hubiera un signo menos delante, la negación del resultado de la conversión, 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 "VÉASE TAMBIÉN" .BR atof "(3), " atoi "(3), " atol "(3), " strtod "(3), " strtol (3) .SH FALLOS Ignora la localización actual.