Jiang Bian Jiang Bian - 1 year ago 93
C Question

Best ways of parsing a URL using C?

I have a URL like this:

I want to parse the URL to get the values:

Port: 8080
page: /servlet/rece

How do I do that?

Answer Source

Write a custom parser or use one of the string replace functions to replace the separator ':' and then use sscanf().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download