src/projects/libc/string/memcmp.c
int memcmp(const void* aptr, const void* bptr, size_t size) {
	const unsigned char* a = (const unsigned char*) aptr;
	const unsigned char* b = (const unsigned char*) bptr;
	for (size_t i = 0; i < size; i++) {
		if (a[i] < b[i])
			return -1;
		else if (b[i] < a[i])
			return 1;
	}
	return 0;
}
/*
  * Compare two blocks of memory.
  *
  * Compares the first size bytes of the block of memory pointed to by aptr to the first size bytes pointed by bptr,
  * returning zero if they all match or a value different from zero representing which is greater if they do not.
  * Notice that, unlike strcmp(), the function does not stop comparing after finding a null character.
  */
Compare two blocks of memory.
Compares the first size bytes of the block of memory pointed to by aptr to the first size bytes pointed by bptr,
returning zero if they all match or a value different from zero representing which is greater if they do not.
Notice that, unlike strcmp(), the function does not stop comparing after finding a null character.
Compare two blocks of memory . Compares the first size bytes of the block of memory pointed to by aptr to the first size bytes pointed by bptr returning zero if they all match or a value different from zero representing which is greater if they do not . Notice that unlike strcmp () the function does not stop comparing after finding a null character .
int memcmp(const void* aptr, const void* bptr, size_t size) {
	const unsigned char* a = (const unsigned char*) aptr;
	const unsigned char* b = (const unsigned char*) bptr;
	for (size_t i = 0; i < size; i++) {
		if (a[i] < b[i])
			return -1;
		else if (b[i] < a[i])
			return 1;
	}
	return 0;
}
int memcmp ( const void * aptr , const void * bptr , size_t size ) { const unsigned char * a = ( const unsigned char * ) aptr ; const unsigned char * b = ( const unsigned char * ) bptr ; for ( size_t i = 0 ; i < size ; i ++ ) { if ( a [ i ] < b [ i ] ) return -1 ; else if ( b [ i ] < a [ i ] ) return 1 ; } return 0 ; }
Compare two blocks of memory.
Compare two blocks of memory .