Re:Checked C: extension to C that adds static and dynamic ch...
by charliesome on Thursday March 15, 2018 @03:32AM
(#16591011)
There is a difference. An empty string in C is a non-null char* pointer pointing to a zero byte. Passing a null pointer to strlen will crash.
[ Parent
| on HN ]
Re:Checked C: extension to C that adds static and dynamic ch...
by esrauch on Thursday March 15, 2018 @03:46AM
(#16591052)
A zero-length array can't ever be a valid cstring at all since they have to be null terminated. I don't think that is actually relevant to the claim you are replying to, which is about arrays and pointers and not strings.