Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. void* Realocate(void*buf, int os, int ns)
  2. {
  3. void*temp;
  4. temp = malloc(os);
  5. memcpy((void*)temp, (void*)buf, os);
  6. free(buf);
  7. buf = malloc(ns);
  8. memset(buf, 0, ns);
  9. memcpy((void*)buf, (void*)temp, ns);
  10. return buf;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement