title: C: Save on a txt file the URL from another text file
body: <p>I need to make a program in C that connects to a web server and download its index.html file. I have already done this correctly but I'm struggling on the second part of the program, the specifications says:</p>
  
  <blockquote>
    <p>If the page contains complete http references, launch a concurrent
    thread to get that page and save it to disk as a file (as before). A
    complete reference means starting by ”http://” and ending by ”.html”</p>
  </blockquote>
  
  <p>While I have already done the code to launch the Thread I don't know how to get all URLs.</p>
  
  <p>This is the pseudocode that I want my thread to execute (and that I think it should work):</p>
  
  <pre><code>Open File;
  
  Read File;
  
  Fill the buffer;
  
  LOOP:
  Search for "http://", Save Position1
  Search for ".html" from the previous saved position, Save Position2
  Save all the string that goes from Save Position1 to Save Position2 in a txt.file using the System Call Write.
  </code></pre>
  
  <p>I've tried functions like strstr and even calculating the size of the file and trying if conditions in a gigantic for statement but anything returned the desired results.</p>
  
  <p>Please keep in mind that I'm a begginer on C programming >.&lt;</p>