3 ms·
In my opinion that is like saying it might more convenient to use sprintf. Yes, that null has to be there for historical reasons. It doesn't mean it is a good
by phicoh 3y ago
In my opinion that is like saying it might more convenient to use sprintf.
Yes, that null has to be there for historical reasons. It doesn't mean it is a good idea to write code that relies on it.
- bloak 3y agoIt seems that (some version of) the C standard contains these words: argv[argc] shall be a null pointer So I wouldn't feel too bad about relying on it.
- lelanthran 3y ago> Yes, that null has to be there for historical reasons. It doesn't mean it is a good idea to write code that relies on it. That null has to be there because if it isn't then the implementation is broken, not the program. If you are coding defensively because the implementation might be broken, then you can't rely on argc being positive either