I read about int vs size_t vs ssize_t , and I understand that int and ssize_t is signed while size_t is unsigned.
Why memcmp return int and no return ssize_t like recv return ssize_t?
I read about int vs size_t vs ssize_t , and I understand that int and ssize_t is signed while size_t is unsigned.
Why memcmp return int and no return ssize_t like recv return ssize_t?
Copyright © 2021 Jogjafile Inc.
An
intis sufficient to hold the return value ofmemcmp.The
memcmpfunction returns 0 if the two given memory regions are equal, a value less than 0 if the first region compares less, and a value greater than 0 if the first region compares more.A
ssize_tmay be larger than anint(and on most implementations it will be), and anintis typically the "natural" word size, so there is no benefit to using the larger size.