最近脑子真不好使
#include <stdio.h>
#include <stdlib.h>
void* icalloc(const unsigned int Multiple,const unsigned int Base);
int main(void)
{
char *ptr = icalloc(5,sizeof(char));
for(int i=0;i<4;++i)
{
*(ptr + i) = 'F';
}
printf("%s\n",ptr);
return 0;
}
void* icalloc(const unsigned int Multiple,const unsigned int Base)
{
void *ptr = malloc(Multiple * Base);
for(void *cptr = ptr;cptr <= ptr + Multiple*Base;++cptr)
{
*(char*)cptr = 0;
}
return ptr;
}