Reading line from text file into C++ system() command
<p>I'm new to C++, and I'm trying to read a string from a text file that only contains one string and use that as input for a system() call. Here's what I have: </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;fstream&gt;

int main(int argc, const char * argv[])
{
    std::string curlString = "/usr/bin/curl -O ";
    std::ifstream file("/Users/test/Desktop/test.txt");
    if (file) {
    std::string line;
    while (std::getline( file, line ));
    system(curlString + line);
    }
 }
</code></pre>

<p>This is probably a complete and utter mess, so thanks so much for helping out, I really appreciate it.</p>

<p>Thanks in advance for any insight! </p>
