There are 2 groups of functions that manipulate multibyte fields
The name begins with a B (representing a byte)
The name begins with Mem (which represents memory).
They do not interpret the data or assume that the data is a C string that ends with a null character
When dealing with the socket address structure, my mom needed these types of functions because my mom needed to manipulate fields such as IP addresses, which could contain bytes of value bit 0, but not C strings.
The C string ending with a null character is handled by a function defined in the <string.h> header file, with the name beginning with Str.
void bzero (void *dest,size_t nbytes)
Bzero sets the specified number of bytes in the target string to 0, often using this function to initialize a socket address structure to 0
void bcopy (const void *src,void *dest,size_t nbytes)
Bcopy moves a specified number of bytes from the source byte string to the destination byte string
int bcmp (const void *ptr1,const void *ptr2,size_t nbyte)
BCMP compares 2 arbitrary strings, returns 0 if same, or not 0
void *memset (void *dest,int c,size_t len)
Memset The specified number of bytes in the target byte string to the value C
void *memcpy (void *dest,const void *src,size_t nbytes)
Memcopy is similar to bcopy, but the order of 2 pointer parameters is reversed
int memcmp (const void *ptr1,const void *ptr2,size_t nbytes)
MEMCMP compares 2 arbitrary byte strings, the same returns 0, if ptr1 refers to a byte string greater than PTR2 refers to the byte string, the return is greater than 0, otherwise less than 0
BYTE manipulation functions