How to read and compare strings from dynamic output console in C Programming?
Consider, you will get one output at a time. You need to consider the output from a Program as an input to other program function. The example output of the Program 1 as follows,
A123#345H5KGH3***STATE***GETRUNOMMUNICATION5619***CONNECTED***HIEDSAKNFH***OK***

I need to get the statement STATE:CONNECTEDOK if this statement present in the output console, then the next program(function) will start.
Note:
I am getting one output at a time
Consider the first output as "A" the next one will be "A1" and the following output as "A12".
I thought to use array to store values, but the output range( unlimited) makes it very lengthy and difficult to configure before hand ,since the length of the array is unknown.
If the specified statement appears in the output console, then it should prompt some message.
No spaces in between the two continues outputs.
I thought to use strings, so my question are as follows,
How to read the string from output console, when the length of the string is unknown?
What function I need to use to perform the comparison ( I already know the statement "STATE:CONNECTEDOK") with unknown length of output?
How to store the output data, when the range or length is unknown?
Thank you.
STATE:CONNECTEDOKmessage in the context of the second using something likeexecl(). Then capture the output from it as you would any input from the user.