Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5597

C/C++ • Re: C++ fgets behaving very oddly on Bookworm (no other environment tested yet)

$
0
0
fgets returns (on success) the value of its first arg (so, whatever type "msgbuf" is/was, that's the type of thing that fgets returns). Yes, I know this language is informal; don't bother nitpicking it.

Anyway, using: while (fgets(...))
is perfectly fine. No need to compare to NULL.

Statistics: Posted by BigRedMailbox — Mon Feb 12, 2024 1:36 pm



Viewing all articles
Browse latest Browse all 5597

Trending Articles