long __stdcall Men32search(long *ptr, long *find, size_t count )
{
size_t w;
count = count - 1;
for (w=0; w<= count; w++ )
{
if ( ptr[w] == find[0] ) return w;
}
return long(-1);
}
上面可以查找出 指定的 Find 值出现在何处问题: c函数有 memchr 它非常快, 可惜只能查找 1个 char有无其他函数可以直接实现 Men32search() 的功能呢 (如同 memchr 不需再写回圈for) 我需要他们的超级快速
Searching:
memchr
Locate character in block of memory (function )
strchr
Locate first occurrence of character in string (function )
strcspn
Get span until character in string (function )
strpbrk
Locate characters in string (function )
strrchr
Locate last occurrence of character in string (function )
strspn
Get span of character set in string (function )
strstr
Locate substring (function )
strtok
Split string into tokens (function )