Can you suggest me any other way of doing this? Please.
J-M-L:
Your code won't work as you don't progress the parsing when you find STAYour while loop will find STA and then
if (!strncmp(part, "ID=", 3))fails because you still point at STA, andif (!strncmp(part, "Pass=", 5))fails because you still point at STA. you arrive at the end of the loop, you get to the next token withpart = strtok(NULL, "/");and go back up to check again agains STA... but this time it' no longer STA, it's ID=... but you don't enter the if clause because it's not STA...long story short, you don't parse the string in the right way...