[aclug-L] Re: Simple C question (which shows my C ignorance)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I'm not sure I follow what you are doing, but if you used malloc to declare
the array, and want to shorten the array by one, shift everything down, and
do a realloc reflecting the new size of the array.
(I assume you didn't need this help for a programming class. ;-)
John
>I need to delete a member of an array of structure pointers and have the
>new situation reflected minus the one removed. Can I just do
>free(array1[i]), then decrement the index counter, or do I need to shift
>everything down? The members were allocated with malloc, and I'm lost.
>Any ideas?
>
>--
>Larry Bottorff / mrprenzl@xxxxxxxxxx / 316.345.3387
|
|