本文共 356 字,大约阅读时间需要 1 分钟。
函数功能:
功能:从buf所指内存区域的前count个字节查找字符ch。 说明:当第一次遇到字符ch时停止查找。 如果成功,返回指向字符ch的指针;否则返回NULL。
void *memchr(const void *buf, int c, unsigned int count) { assert(buf != NULL); while (count --) { if (*(char *) buf == c) return (void *) buf; buf = (char *) buf + 1; } return NULL; }
转载地址:http://zmryb.baihongyu.com/