wonnie
wonnie

Reputation: 479

Extracting url from string in C

How can i extract urls from a string in C?

Say we have "bla bla bla bla bla blaaa http://www.stackoverflow.com blaaa bllaaa"

i want to pass that link to a varible.

How can i do that?

Thanks.

Upvotes: 1

Views: 496

Answers (1)

Svisstack
Svisstack

Reputation: 16656

  1. Search for "http://" using strstr function.
  2. Starting for this pointer stop on first null or space, if space set on this position null.
  3. Now you pointer resulted in step 1, pointing to your url.

Upvotes: 2

Related Questions