3 ms·
It's not. But plenty of other standard C functions like to use 0-terminated strings without explicit lengths, including most of the system interfaces, and other
by naniwaduni 7y ago
It's not. But plenty of other standard C functions like to use 0-terminated strings without explicit lengths, including most of the system interfaces, and others make it awkward to pass in the length that you're actually tracking. You only need to call one of those with an unterminated string and it doesn't even matter whether your code knows the string's length.
You could say that just means you have to be very careful whenever you pass a pointer to a string around without also passing in its length, but that's a lot of places.