MicrOS
memcmp.c File Reference
#include "../string.h"

Functions

int memcmp (const void *buffer1, const void *buffer2, size_t size)
 Compare two blocks of memory. More...
 

Function Documentation

◆ memcmp()

int memcmp ( const void *  buffer1,
const void *  buffer2,
size_t  size 
)

Compare two blocks of memory.

Compares the first num bytes of the block of memory pointed by ptr1 to the first num bytes pointed by ptr2, returning zero if they all match or a value different from zero representing which is greater if they do not.

Parameters
ptr1Pointer to block of memory.
ptr2Pointer to block of memory.
numNumber of bytes to compare.
Returns
Returns an integral value indicating the relationship between the content of the memory blocks (<0: value in ptr1 was lower than in ptr2, 0: both are equals, >0: value in ptr2 was greater than in ptr2).