[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]
On Thu, 3 Feb 2000, Larry Bottorff wrote:
Let me simplify things, make sure I understand what's going on:
> I do a malloc for each member of the array (of stuctures):
> array1[count] = ... as I need it after declaring
> array1[NUM] beforehand. Then I need to remove a given member of array1.
> If I shift everything down, how do I use realloc?
skip the realloc and just use a for() loop. Loop from the one you
want deleted until NUM-1; assign [i] = [i+1]. Decrement NUM by 1.
-jeff
--
ed is the standard text editor. http://www.gnu.org/fun/jokes/ed.msg.html
|
|