Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char* createMemory() {
- char *buf = malloc(100);
- int *size = (int*)buf;
- *size = 100;
- return (char*)(size+1);
- }
- void deleteMemory(char* buf) {
- int* size = ((int*)buf)-1;
- int blocksize = *size;
- free(size);
- }
Add Comment
Please, Sign In to add comment