I have to read strings of different length in C.I can do it using an array of pointers and using ,alloc inside the loop.The problem is that the input to the program is a series of sentences like this:
Rene Decartes once said,
“I think, therefore I am.”
and there can be many more. How can I check programmaticaly that the user has finished giving the input sentences.
Maybe he’s even looking for the end-of-file (end of input, end of stream). You can detect the end of the input stream by checking the return value of various input functions. You did not tell us which function you use for reading input. E.g. with
fgets()and input on standard input you would do