Deutsch English Français Italiano |
<20240621185314.00004fda@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feed.opticnetworks.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: The difference between strtol() and strtoul() ? Date: Fri, 21 Jun 2024 18:53:14 +0300 Organization: A noiseless patient Spider Lines: 26 Message-ID: <20240621185314.00004fda@yahoo.com> References: <v51d1l$2fklr$1@news.xmission.com> <v540t9$2gsdu$1@news.xmission.com> <20240621182839.00000dc4@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Fri, 21 Jun 2024 17:53:21 +0200 (CEST) Injection-Info: dont-email.me; posting-host="993f825e38e46acfbd70d7821a00500d"; logging-data="3339403"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LL5btftNHqFcNVfcZ4GY8i9aSeX2Pc1k=" Cancel-Lock: sha1:uHaFZy+9R0I3zxC733JeasL72ww= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) Bytes: 1859 On Fri, 21 Jun 2024 18:28:39 +0300 Michael S <already5chosen@yahoo.com> wrote: > On Fri, 21 Jun 2024 13:58:01 -0000 (UTC) > gazelle@shell.xmission.com (Kenny McCormack) wrote: > > > > Yeah, now I get it. You really only need strtoimax() and > > strtoumax(). > > Which are? uunfortunately, not part of C standard. > > > A result of any smaller type can be obtained by calling one of these > > functions and storing the result in an object of the smaller type. > > > > Or check for range and handle out of range values as appropriate by > situation. > > BTW, I don't know what The Standard says about out-of-range inputs, but at least https://en.cppreference.com/w/c/string/byte/strtol does not say anything certain. especially about what stored in *str_end.