Sujet : Re: Buffer contents well-defined after fgets() reaches EOF ?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 16. Feb 2025, 19:21:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <votaag$n41b$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 16.02.2025 08:32, Kaz Kylheku wrote:
I would recommend learning about strspn and strcspn, and writing
your own tokenizing loop:
Incidentally, in a recent toy project, I used it for parsing simple
syntax.
For the code of this thread the strtok() was simpler to use, though.
The strok function is ill-suited to many situations. For instance,
there are situations in which you do want empty tokens, like CSV, such
that ",abc,def," shows four tokens, two of them empty.
Sure. (Always use an appropriate solution for any given task.)
Janis
[...]