Johnny - memcmp

New About Yours API Help
701 bytes, Plain text
I love the show and am a big fan.  I enjoyed the article about memcmp I must point out that it would be much better that when working with character type data it would be much better to use strncmp and proper lengths than to use a byte level memory comparison function for character type data.  However I am still trying to figure out what C programmer would ever do memcmp("a","bc",3);  I just don't see that happening.  I do thank the author of the article to point out the undefined behavior but I don't think this is a bug since reasonable C programmers probably wouldn't write code like this.  Anyway test the sizeof your memory buffers before you pass them to functions.

Happy Coding,
Pasted 10 months ago — Expires in 63 days