digittoint(3) | convert a numeric character to its integer value |
ctype, digittoint, isalnum, isalpha, isascii, iscntrl, isdigit, isgraph, ishexnumber, isideogram, islower, isnumber, isphonogram, isprint, ispunct, isrune, isspace, isspecial, isupper, isxdigit, toascii, tolower, toupper, isblank(3) | character classification functions |
DIGITTOINT(3) | MidnightBSD Library Functions Manual | DIGITTOINT(3) |
digittoint
—
convert a numeric character to its integer value
Standard C Library (libc, -lc)
#include
<ctype.h>
int
digittoint
(int
c);
int
digittoint_l
(int
c, locale_t
loc);
The
digittoint
()
function converts a numeric character to its corresponding integer value.
The character can be any decimal digit or hexadecimal digit. With
hexadecimal characters, the case of the values does not matter.
The
digittoint_l
()
function takes an explicit locale argument, whereas the
digittoint
() function use the current global or
per-thread locale.
The digittoint
() function always returns
an integer from the range of 0 to 15. If the given character was not a digit
as defined by
isxdigit(3), the
function will return 0.
April 6, 2001 | midnightbsd-3.1 |