Merit of signed comparison return of memcmp

59 Views Asked by At

What is a merit for the signed int return value of memcmp compared to say bool?

I don't think I've ever used the return value of memcmp other than to compare it against zero.

1

There are 1 best solutions below

0
chux - Reinstate Monica On BEST ANSWER

What is a merit for the signed int return value of memcmp

Useful for sorting objects based on their binary representation.

Note: memcmp() returns a +,0,- based on the first mismatched byte as if bytes are unsigned char, not char.