title: How do I open a URL from C++?
body: <p>how can I open a URL from my C++ program?</p>
  
  <p>In ruby you can do </p>
  
  <pre><code>%x(open https://google.com)
  </code></pre>
  
  <p>What's the equivalent in C++? I wonder if there's a platform-independent solution. But if there isn't, I'd like the Unix/Mac better :)</p>
  
  <p>Here's my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;fstream&gt;
  
  int main (int argc, char *argv[])
  {
      char url[1000] = "https://www.google.com";
  
      std::fstream fs;
      fs.open(url);
      fs.close();
  
      return 0;
  }
  </code></pre>