I am trying to parse the following string:
The first line and second line are separated by a \r and \n.
Now, each of these messages will be proceeded by either OK or ERROR, as this is from a GSM module.
Could anyone help me parse out the whole thing and check?
I've got the following so far:
This works in practice when everything is on one line, but when OK and the message I'm trying to parse are on separate lines, the check against "stat" being in the string fails.
data[i] = getch();
if((data[i] == 'O' || data[i] == 'K') && flag <2)
Any help with this would be greatly appreciated.