HW09 comments ____________________________________________________________ find_substring You need whichever of the needles begins first in the haystack. needles: - == -AND- 0123456789012 haystack: AA==BB-AND-CC ▲ pos (start) Call #1 to find_substring(…) will return idx=2 and needle="==". 012345678 haystack: AA==BB-AND-CC ▲ pos (start) Call #2 to find_substring(…) will return idx=2 and needle="-". 012345 haystack: AA==BB-AND-CC ▲ pos (start) Call #3 to find_substring(…) will return idx=3 and needle="-". 01 haystack: AA==BB-AND-CC ▲ pos (start) Call #4 to find_substring(…) will return idx=0 and needle=NULL. pos will be unchanged. ____________________________________________________________ split_string(…) Suggested outline count # of delimiters in the input string -- call find_substring(…) repeatedly until it returns a FindResult with .needle==NULL allocate (malloc) space for the outer array (char**) Loop find_substring(…) if a needle was found Add a copy (on heap) of the body part (before needle) to the outer array Add a copy (on heap) of the needle to the outer array else Break Add copy (on heap) of the remaining body (after the last needle found) to the outer array // Okay to copy/adapt this outline in your COMMENTS. ============================================================ Linked lists Order matters a lot for creating, destroying, and modifying linked lists. When in doubt, draw a picture. Good diagram (in Java but doesn't matter) https://beginnersbook.com/2013/12/linkedlist-in-java-with-example/