1ustrtol(3)                      Allegro manual                      ustrtol(3)
2
3
4

NAME

6       ustrtol  -  Converts a string into an integer. Allegro game programming
7       library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       long ustrtol(const char *s, char **endp, int base);
14

DESCRIPTION

16       This function converts the initial part of `s'  to  a  signed  integer,
17       setting  `*endp'  to  point to the first unused character, if `endp' is
18       not a NULL pointer. The `base' argument indicates what base the  digits
19       (or  letters)  should  be  treated  as.  If `base' is zero, the base is
20       determined by looking for `0x', `0X', or `0' as the first part  of  the
21       string,  and  sets  the  base used to 16, 16, or 8 if it finds one. The
22       default base is 10 if none of those prefixes are found. Example:
23
24          char *endp, *string = "456.203 askdfg";
25          int number = ustrtol(string, &endp, 10);
26

RETURN VALUE

28       Returns the string converted as a value of type `long int'. If  nothing
29       was  converted,  returns zero with `*endp' pointing to the beginning of
30       `s'.
31
32

SEE ALSO

34       uconvert(3), ustrtod(3), uatof(3)
35
36
37
38Allegro                          version 4.4.2                      ustrtol(3)
Impressum