Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!van-bc!rsoft!mindlink!a50 From: a50@mindlink.UUCP (Cliff Lum) Newsgroups: comp.lang.c Subject: Re: Microsoft C V5.1 halloc() problem. Message-ID: <2713@mindlink.UUCP> Date: 3 Aug 90 22:21:26 GMT Organization: MIND LINK! - British Columbia, Canada Lines: 18 A NULL return indicates a memory allocation fail because of insufficient space or bad values of the arguments. here is some sample code #include #define MAX_SIZE 100000L main() short huge *larray; if (( larray = (short huge *)halloc(MAX_SIZE, sizeof(short))) == NULL { printf("Alocation by halloc failed "); exit(0); } printf("Allocated"); hfree(void huge *)larray); /* free the array */ } /* also missing the { after main() */ example call p_huge = (short huge *)halloc(100000, sizeof(short));