PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Creating new strings for nine20
Date: Sunday, 12 Apr 2020, 21:30:46


    > Message Posted By: Unknown
    >
    > I saw another question yesterday and I have a similar issue where I am not
    > able to figure out how to dynamically allocate new strings P' and add them
    > to the queue (I keep overriding the same pointer, and lose previous
    > strings). For example if I have P as aba-, I can then go have P' as ab-a
    > or a-ab, but I am unable to figure out a way to allocate space for both of
    > these P'.

Every time that you create a new string, do so in
newly malloc()-ed space.  If you do not add it to
the hash table or queue, free it.

--Stan-
PREV INDEX NEXT