Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: leger_v AT bluewin DOT ch, djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Problem with malloc() and integers Date: Sun, 26 Apr 1998 20:23:09 -0700 Message-ID: <19980427032245.AAI5484@ppp100.cartsys.com> Precedence: bulk At 09:44 4/26/1998 +0200, leger_v AT bluewin DOT ch wrote: >Than a lot. I couldn't continue my program without the malloc(long) >function. I believed that the (unsigned long *) provided a long >allocation but I got wrong. `malloc' has no way of knowing what type you are going to store in the memory, and the (unsigned long *) bit is just a cast (for more info on which see a C book). Incidentally, you should also check in each case whether `malloc' returns NULL, because you don't really know how much memory is available. It might be less than (64K * 4 * 10). Nate Eldredge nate AT cartsys DOT com