News for hackers. Stuff that matters.
Re:C Strings and my slow descent to madness by tom_ on Thursday April 06, 2023 @11:18AM (#35469499)
Re:C Strings and my slow descent to madness by TremendousJudge on Thursday April 06, 2023 @02:58PM (#35472802)
I love how in every C code snippet on every comment on this thread, somebody got something wrong. I take it as a sign that it's probably best to avoid C as much as possible.
Re:C Strings and my slow descent to madness by giantrobot on Thursday April 06, 2023 @05:32PM (#35474803)
! multithreaded it's not Hey, at least code
Re:C Strings and my slow descent to madness by avar on Thursday April 06, 2023 @06:30PM (#35475405)
Any C compiler that isn't a trivial toy implementation will warn about that, so it's hardly a C gotcha.
Re:C Strings and my slow descent to madness by tom_ on Thursday April 06, 2023 @08:48PM (#35476654)
clang and VC++ for x64 warn about this out of the box, but gcc seems to need -Wall.
Re:C Strings and my slow descent to madness by lolcatuser on Thursday April 06, 2023 @06:56PM (#35475664)
Maybe my least favorite "feature" of C. I can manage most aspects of zero-terminated strings well enough, but when I have to specify the length of them, is it an 'int', 'size_t', 'ssize_t', or something else? (Answer: All of the above!)