Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for chqrlie
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #281519 |
You might mention the philosophy behind the `*_s` functions: make constraint violations fatal errors. Indeed they call a *handler* that may report the error to the user and exit the program. The problem is the default behavior if the handler ignores the problem: the destination string is set to the e... (more) |
— | over 2 years ago |
Edit | Post #286194 | Initial revision | — | over 2 years ago |
Answer | — |
A: Should I check if pointer parameters are null pointers? Whether null pointer checking should be the caller's responsibility or the callee is debatable and probably a matter of opinion, local convention, sometimes logical choices but in all cases should be documented explicitly. Consider for example `memcpy()`: it is the caller's responsibility, the beh... (more) |
— | over 2 years ago |
Comment | Post #286191 |
I agree with you analysis. There is a problem with one of the examples: you should use `for(size_t i = 0; i < sizeof(array) / sizeof(*array); i++)` instead of `for(size_t i=0; i<n; i++)` as it would only be a coincidence if there were `n` entries in this array. (more) |
— | over 2 years ago |