News for hackers. Stuff that matters.
Re:The Nitty Gritty of “Hello World” on macOS (2014) by radiospiel on Wednesday May 06, 2020 @06:07AM (#23089391)
Shouldn't this be

    fwrite("Hello, world!\n", 1, 14, stdout)
instead? After all, the string is 14 characters in length, not including the terminating NUL char. What does writing a NUL char to stdout do, anyways?
Re:The Nitty Gritty of “Hello World” on macOS (2014) by AlEinstein on Wednesday May 06, 2020 @07:51AM (#23089928)
You are correct!

To answer your question, writing a NUL char to stdout is no problem. Some utilities can actually use it as a delimiter since it’s so uncommon. I think most shells would just print nothing on the screen.

Re:The Nitty Gritty of “Hello World” on macOS (2014) by joesavage on Wednesday May 06, 2020 @08:02AM (#23089993)
Oops, quite right. I’ll try and push up a correction later today. Thanks!