1strtoimax(3C) Standard C Library Functions strtoimax(3C)
2
3
4
6 strtoimax, strtoumax - convert string to integer type
7
9 #include <inttypes.h>
10
11 intmax_t strtoimax(const char *restrict nptr,
12 char **restrict endptr, int base);
13
14
15 uintmax_t strtoumax(const char *restrict nptr,
16 char **restrict endptr, int base);
17
18
20 These functions are equivalent to the strtol(), strtoll(), strtoul(),
21 and strtoull() functions, except that the initial portion of the string
22 is converted to intmax_t and uintmax_t representation, respectively.
23
25 These functions return the converted value, if any.
26
27
28 If no conversion could be performed, 0 is returned.
29
30
31 If the correct value is outside the range of representable values,
32 {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} is returned (according to
33 the return type and sign of the value, if any), and errno is set to
34 ERANGE.
35
37 These functions will fail if:
38
39 ERANGE The value to be returned is not representable.
40
41
42
43 These functions may fail if:
44
45 EINVAL The value of base is not supported.
46
47
49 See attributes(5) for descriptions of the following attributes:
50
51
52
53
54 ┌─────────────────────────────┬─────────────────────────────┐
55 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
56 ├─────────────────────────────┼─────────────────────────────┤
57 │Interface Stability │Standard │
58 ├─────────────────────────────┼─────────────────────────────┤
59 │MT-Level │MT-Safe │
60 └─────────────────────────────┴─────────────────────────────┘
61
63 strtol(3C), strtoul(3C), attributes(5), standards(5)
64
65
66
67SunOS 5.11 1 Nov 2003 strtoimax(3C)