[C] memchr / memchr.c / memchr in c
2022. 7. 25. 17:27ㆍ🧑🏻💻/C & C++
void *memchr(const void *s, int c, size_t n)
{
unsigned char *s_dst;
unsigned char find;
find = c;
s_dst = (unsigned char *)s;
while (n--)
{
if (*s_dst == find)
return (s_dst);
s_dst++;
}
return (0);
}
'🧑🏻💻 > C & C++' 카테고리의 다른 글
[C] memcpy / memcpy.c / memcpy in c (0) | 2022.07.25 |
---|---|
[C] memcmp / memcmp.c / memcmp in c (0) | 2022.07.25 |
[C] itoa / itoa.c / itoa in c (0) | 2022.07.25 |
[C] isprint / isprint.c / isprint in c (0) | 2022.07.13 |
[C] isascii / isascii.c / isascii in c (0) | 2022.07.13 |