memicmp
mem.h:インデックス への移動
ヘッダーファイル
mem.h,string.h
カテゴリ
メモリと文字列の操作ルーチン
プロトタイプ
int memicmp(const void *s1, const void *s2, size_t n);
説明
2 つの文字配列の n バイトを比較します。大文字と小文字は区別しません。
memicmp は,UNIX System V システムで使用できます。
memicmp は,大文字と小文字を区別しないで,ブロック s1 と s2 の最初の n バイトを比較します。
戻り値
memicmp は次の値を返します。
- s1 が s2 より小さい場合は,< 0
- s1 と s2 が同じ場合は,= 0
- s1 が s2 より大きい場合は,> 0
例
#include <stdio.h>
#include <string.h>
int main(void)
{
char *buf1 = "ABCDE123";
char *buf2 = "abcde456";
int stat;
stat = memicmp(buf1, buf2, 5);
printf("The strings to position 5 are ");
if (stat)
printf("not ");
printf("the same\n");
return 0;
}
移植性
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |