Path: utzoo!mnetor!uunet!husc6!bbn!rochester!udel!mmdf From: dsill@nswc-oas.arpa (Dave Sill) Newsgroups: comp.sys.amiga Subject: 'void *' (was Re: malloc() prob. on 3.4a) Message-ID: <2122@louie.udel.EDU> Date: 18 Apr 88 19:29:30 GMT Sender: mmdf@udel.EDU Lines: 20 Matt Dillon writes: > ... But what happens when you use AllocMem() to allocate > a structure, then an array of something, then some other > structure, etc....? void * gets to be *real* useful and makes > code a lot easier to understand. That's when you use a cast. You can't simply pretend all pointers are `void *'. It's just not right. And what happens when someone tries to compile your code with a compiler that doesn't handle `void *'? As for readability, several people have posted macros for NEW and FREE that allow you to correctly and readably manipulate pointers returned by AllocMem(). ========= The opinions expressed above are mine. "I no longer think of something as a computer unless it's connected to a network." -- Peter Weinberger