Sujet : Re: The difference between strtol() and strtoul() ?
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.lang.cDate : 21. Jun 2024, 00:35:37
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <v52ec9$2g59p$1@news.xmission.com>
References : 1 2
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
20240620154213.917@kylheku.com>,
Kaz Kylheku <
643-408-1753@kylheku.com> wrote:
...
If strtol didn't exist today, making it necessary to invent it or
something like it, that function should use the intmax_t type.
Then there wouldn't be any need to add new variants going forward.
There actually is.
STRTOIMAX(3) Linux Programmer's Manual STRTOIMAX(3)
NAME
strtoimax, strtoumax - convert string to integer
SYNOPSIS
#include <inttypes.h>
intmax_t strtoimax(const char *nptr, char **endptr, int base);
uintmax_t strtoumax(const char *nptr, char **endptr, int base);
DESCRIPTION
These functions are just like strtol(3) and strtoul(3), except that
they return a value of type intmax_t and uintmax_t, respectively.
-- Conservatives want smaller government for the same reason criminals want fewer cops.