Why do I need to allocate anything? It's already allocated all the memory
needed for the helpfiles already. I'm just sorting what it's already
allocated...

----- Original Message ----- 
From: "Richard Lindsey" <[EMAIL PROTECTED]>
To: "Chad Simmons" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Wednesday, January 28, 2004 10:51 AM
Subject: RE: Qsort


One quick edit on that last post... I think that...

   /* Count the members in the linked list */
   for (nmemb = 0, help = help_first; help != NULL; help =
help->next,nmemb++);

   return if(!nmemb);

   /* Create an array to store them */
   help_array= alloc_mem(sizeof(help) * i);
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this line

should actually read:

   help_array= alloc_mem(sizeof(help) * nmemb);

so that it allocates the sizeof help times the number of elements it
counted in that first for loop...

Richard Lindsey


-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom


Reply via email to