Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #168600
| Path | csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: string to size_t |
| Date | Mon, 19 Dec 2022 12:07:41 -0800 |
| Organization | None to speak of |
| Lines | 20 |
| Message-ID | <871qovrwc2.fsf@nosuchdomain.example.com> (permalink) |
| References | <tnph4t$8ind$1@dont-email.me> <87r0wvs291.fsf@nosuchdomain.example.com> <8e2oL.103648$gGD7.17914@fx11.iad> |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | reader01.eternal-september.org; posting-host="8e7fdbea1bc660c36eba0e0212d247ec"; logging-data="463869"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UdzkG7gOElaZ8JxJpqJzx" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
| Cancel-Lock | sha1:C/NiRkG0FNmcPfkrbyGgZ6igyDo= sha1:dwZ41/rknO5lHGxIhdqpb/pcV/8= |
| Xref | csiph.com comp.lang.c:168600 |
Show key headers only | View raw
scott@slp53.sl.home (Scott Lurndal) writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
[...]
>>What is the point of trying strotoimax before using strotoumax?
>>Just call strtotumax and convert the result to size_t.
>
> What's wrong with strtoul?
size_t can be wider than unsigned long. On modern Windows, for example,
unsigned long is 32 bits and size_t is 64 bits.
strtoull could also work (and as far as I know there are no current
implementations with uintmax_t wider than unsigned long long), but
strtoumax (which I misspelled above) makes the point more clearly.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
string to size_t Oğuz <oguzismailuysal@gmail.com> - 2022-12-19 14:15 +0300
Re: string to size_t Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-19 09:59 -0800
Re: string to size_t Oğuz <oguzismailuysal@gmail.com> - 2022-12-19 21:34 +0300
Re: string to size_t Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-19 10:49 -0800
Re: string to size_t Richard Damon <Richard@Damon-Family.org> - 2022-12-19 14:29 -0500
Re: string to size_t Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-19 12:05 -0800
Re: string to size_t scott@slp53.sl.home (Scott Lurndal) - 2022-12-19 18:40 +0000
Re: string to size_t Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-19 12:07 -0800
Re: string to size_t scott@slp53.sl.home (Scott Lurndal) - 2022-12-19 20:31 +0000
Re: string to size_t Tony Oliver <guinness.tony@gmail.com> - 2022-12-19 16:33 -0800
Re: string to size_t Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-19 11:20 -0800
Re: string to size_t Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-19 22:16 +0000
csiph-web