Aspects


vs


Memcmp

Memcmp is a function available in the string.h library.

Strcmp

Strcmp is a string compare function that is available in languages such as C, C++, PHP, Python and MATLAB.

Simpler places lengths

Quality Example
Faster

"If you always keep track of the lengths of your strings you can compare lengths and use memcmp which is faster than strcmp"

from question "C++ string comparison in one clock cycle"

Simpler

"Memcmp is simpler than strcmp and can be implemented even more efficiently in places where the strings are known to be properly aligned"

from question "What is the fastest way to compare two strings in C?"

Others

Quality Example
Better

"Rest assured though that strcmp is better equipped in the general case for string comparisons than memcmp is"

from question "What is the difference between memcmp, strcmp and strncmp in C?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0