Home > Electronics Tutorials > C Language Tutorial > string.h - memcmp

C Language Programming Library Reference Guide

string.h - memcmp

Declaration: int memcmp(const void *str1, const void *str2, size_t n); Compares the first n bytes of str1 and str2. Does not stop comparing even after the null character (it always checks n characters).

Returns zero if the first n bytes of str1 and str2 are equal. Returns less than zero or greater than zero if str1 is less than or greater than str2 respectively.

Note: To report broken links or to submit your projects, tutorials please email to Webmaster