Dear all,
What is the standard file to use memcmp? i am getting repeatedly "memcmp is undefined."
Printable View
Dear all,
What is the standard file to use memcmp? i am getting repeatedly "memcmp is undefined."
I've always wondered why they put it in string.h instead of something like memory.h.
Because I suspect it was part of the same (small set of) source file(s) - probably written in assembler to make the best performance. And since the group of memcpy, strcpy, strcat and group of memcmp, strcmp are often quite alike, it's possible to re-use some of the code in one from the other,e.g. use strlen() + memcpy() to do strcpy(), strcat() - or write some code that is shared by both.
--
Mats