3 ms·
This is nonsense. The error is here: > buffer[4] = '\n' — puts a newline at the last position > gets(buffer) — the function stops when it hits that newline B
by JohnFen 1y ago
This is nonsense. The error is here:
> buffer[4] = '\n' — puts a newline at the last position
> gets(buffer) — the function stops when it hits that newline
But gets() doesn't stop when it hits that newline. It stops when a newline appears in the input stream, not in the buffer the input is being copied to.
Besides, good luck finding a modern compiler that still supports gets() at all.
- DenisDolya 1y agoThank you, your criticism is at least technical, another comment under this post is completely rude.