Date: Thu, 12 May 1994 14:09:43 -0400 (EDT) From: Chris Tate To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: malloc, calloc, free, cfree.... Just to set the record straight, cfree() is *NOT* an ANSI C function. free() is used to free memory allocated by *either* malloc() or calloc(), according to the ANSI spec. Kernighan & Richie, 2e, gives the following in its summary of the standard ANSI C library functions: "void free(void *p) free deallocates the space pointed to by p; it does nothing if p is NULL. p must be a pointer to space previously allocated by calloc, malloc, or realloc." The only differences between malloc() and calloc() are the exact way in which the size of the desired blocks are specified (malloc() takes a size_t expressing the size in bytes of the block, calloc() takes two arguments - "give me n blocks of size s"), and the fact that calloc() clears the entire block to zeros before returning. -- Chris Tate fixer AT faxcsl DOT dcrt DOT nih DOT gov