I have a functions that splits one string into many. I don't know how may strings there will be when its done; but I need to allocate enough memory to hold all of the pointers before actually splitting.

The only solution I can think of is to split twice, once to count how strings there will be and allocate memory. Then split again and store the pointers.

p.s. Check out this poll.
Posted on 2001-11-16 04:26:30 by eet_1024
You couldu uses gloabalalloc to store enought memnory for the initial pointers. Then whenever you need more memory use GlobalReAlloc to extend the array of pointers.
Posted on 2001-11-16 05:10:46 by Eóin
Another solution would be to use a linked list...
Posted on 2001-11-16 07:47:28 by f0dder
GlobalReAlloc should work fine.

Thanks.
Posted on 2001-11-20 15:31:59 by eet_1024