memset()函数的实现
_CRTIMP void* __cdecl memset (void*, int, size_t);
memset()函数的实现
文章目录
memset()函数
c
_CRTIMP void* __cdecl memset (void*, int, size_t);
c
void* memset(void* src, int val, size_t count)
{
char *char_src = (char *)src;
while(count>0) {
*char_src = val;
char_src++;
count--;
}
return src;
}