Liste des Groupes | Revenir à cl c |
On Mon, 10 Feb 2025 22:33:03 -0500, James Kuyper wrote:...
"The fgets function reads at most one less than the number of characters
specified by n from the stream pointed to by stream into the array
pointed to by s." (7.32.7.2p2)
>
If the buffer length is 1, "at most one less than the number ...
specified" is 0. Therefore, fgets() cannot read any characters into the
buffer, no matter what the contents of the input stream are. Again,
since there is no "last byte read into the array", there is no location
where a null byte should be written.
Have you tried it? I have.
Les messages affichés proviennent d'usenet.