prev up next   top/contents search

comp.lang.c FAQ list · Question 7.9

Q: I wrote a little wrapper around malloc, but it doesn't work:

	#include <stdio.h>
	#include <stdlib.h>

	mymalloc(void *retp, size_t size)
	{
		retp = malloc(size);
		if(retp == NULL) {
			fprintf(stderr, "out of memory\n");
			exit(EXIT_FAILURE);
		}
	}


A: See question 4.8. (In this case, you'll want to have mymalloc return the malloc'ed pointer.)


prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North