1.void指针
2.实现memset
void* my_memset(void* p, char v, int size)
{
void* ret = p;
char* dest = (char*)p;//一定养成习惯强制转换
int i = 0;
for(i=0; i<size; i++)
{
dest[i] = v;
}
return ret;
}
1.void指针
2.实现memset
void* my_memset(void* p, char v, int size)
{
void* ret = p;
char* dest = (char*)p;//一定养成习惯强制转换
int i = 0;
for(i=0; i<size; i++)
{
dest[i] = v;
}
return ret;
}