Dear All,
I am trying to solve a problem of dynamically allocated 2D array. My goal is to develop program that will scan at the input unknown number of sentences of unknown length in this format: "float number, colon, text" f.e:
30:How are you?
80:A dog is an animal.
35.5:I like ice cream and coke.
...
After the end of inputs, set of questions follows, user wants to find out whether there is matching pattern like:
Question:
> how
Found:
30:How are you?
Question:
> I like
Found:
35.5: I like ice cream and coke.
Question:
> Cat
Found:
nothing
At first I will have to probably save these sentences dynamically into 2D array with realloc function, but I do not know how to do that if I do not know the length of every sentence nor the number of sentences.
Thank you for your suggestions.