What's the easiest way to parse a string in C?

Posted by Luca Matteis on Stack Overflow See other posts from Stack Overflow or by Luca Matteis
Published on 2010-05-13T14:47:05Z Indexed on 2010/05/13 14:54 UTC
Read the original article Hit count: 193

Filed under:
|

I have to parse this string in C:

XFR 3 NS 207.46.106.118:1863 0 207.46.104.20:1863\r\n

And be able to get the 207.46.106.118 part and 1863 part (the first ip address).

I know I could go char by char and eventually find my way through it, but what's the easiest way to get this information, given that the IP address in the string could change to a different format (with less digits)?

© Stack Overflow or respective owner

Related posts about c

    Related posts about parsing