Dear all,
What is the standard file to use memcmp? i am getting repeatedly "memcmp is undefined."
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.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.