_mbsspnp
string.h:インデックス への移動
ヘッダー ファイル
mbstring.h
カテゴリ
メモリおよび文字列操作ルーチン
プロトタイプ
unsigned char *_mbsspnp(const unsigned char *s1, const unsigned char *s2);
説明
これらの関数はそれぞれ、s1 に含まれていて s2 に含まれていない最初の文字を検索します。
tchar.h に定義されている移植性のあるマクロ _tcsspnp を使用すると、これらの関数を利用できます。
戻り値
これらの関数は、s2 の文字集合に含まれていない s1 の最初の文字のポインタを返します。
s1 のどの文字もすべて s2 に含まれている場合、各関数は NULL を返します。
例
#include <stdio.h> #include <string.h> #include <alloc.h> int main(void) { char *string1 = "1234567890"; char *string2 = "123DC8"; int length; length = strspn(string1, string2); printf("Character where strings differ is at position %d\n", length); return 0; }