EN JA
MEMCMP(3)
MEMCMP(3) Linux Programmer's Manual MEMCMP(3)

名前

memcmp -メモリ領域を比較する

書式


#include <string.h>
 

int memcmp(const void * s1 , const void * s2 , size_t n );

説明

memcmp() 関数は、メモリ領域 s1s2 の最初の n バイトを比較する (各バイトは unsigned char として解釈される)。

返り値

memcmp() 関数は、 s1 の最初の n バイトが s2 の最初の n バイトよりも小さいか、同じか、あるいは大きいかによってそれぞれ、負の整数、0、正の整数を返す。
 
For a nonzero return value, the sign is determined by the sign of the difference between the first pair of bytes (interpreted as unsigned char) that differ in s1 and s2.

準拠

SVr4, 4.3BSD, C89, C99, POSIX.1-2001.

関連項目

bcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strncasecmp(3), strncmp(3), wmemcmp(3)

この文書について

この man ページは Linux man-pages プロジェクトのリリース 3.51 の一部である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man-pages/ に書かれている。
2012-11-25