Unknown error in c++ program : <p>I have a c++ program which opens an url depending in what the user inputs.</p>

<p>Here's the code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int main(){
    int i = 1;
    string google = "https://www.google.com/search?q=";
    string input;
    getline(cin, input);
    string changeSpace(string input)
    {
        for (int i = 0; i &lt; text.length(); i++)
        {
            if (text[i] == ' ')
                text[i] = '+';
        }
        return text;
    }
    input = changeSpace(input);
    cout &lt;&lt; input &lt;&lt; endl;
    string url = string(google + input);
    system(string("start " + url).c_str());
    cout &lt;&lt; url &lt;&lt; endl;
}
</code></pre>

<p>The error is here:</p>

<pre><code>string changeSpace(string input)
{
</code></pre>

<p>In the bracket it says it expected a " ; "</p>

<p>And I don't know why ocurrs that error, it may be a simple mistake, but I don't know it.</p>

<p>Please help me.</p>
