Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void *calloc(size_t nelem, size_t elsize) {
- size_t size = nelem * elsize; // TODO: check for overflow.
- void *ptr = malloc(size);
- memset(ptr, 0, size);
- return ptr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement