title: C++ error: expected primary-expression before ‘}’ token
body: <p>I am trying to call a void function named <code>correction(original,corrected)</code> and when I'm trying to compile it I get a couple of errors of the form: </p>
  
  <blockquote>
    <p>error: expected primary-expression before ‘}’ token</p>
  </blockquote>
  
  <p>Here is my complete code:</p>
  
  <pre><code>    #include &lt;cstdio&gt;
      #include &lt;iostream&gt;
      #include &lt;fstream&gt;
      #include &lt;cstdlib&gt;
      #include &lt;string&gt;
  
      using namespace std;
  
      void correction(ifstream&amp; original,ofstream&amp; corrected);
  
      int main ()
      {
        ifstream original;
        ofstream corrected;
        char filename[16];
        cout&lt;&lt;"Enter filename:\n";
        cin&gt;&gt;filename;
        original.open(filename);
        corrected.open("corrected.txt");
        if (original.fail( ))
          {
      cout &lt;&lt; "Input file opening failed.\n";
            exit(1);
          }
      if (corrected.fail( ))
        {
          cout &lt;&lt; "Input file opening failed.\n";
          exit(1);
        }
       else
         {
           correction(original,corrected);
  }
   return 0;
  }
  
  void correction(ifstream&amp; original,ofstream&amp; corrected)
  {
  char symbol;
  while(! original.eof())
    {
      original.get(symbol);
      if (symbol== 'c')
  {
       corrected.put(symbol);
       original.get(symbol);
       if (symbol=='i')
         {
           corrected.put(symbol);
           original.get(symbol);
           if (symbol=='n')
             {
               corrected.put(symbol);
               original.get(symbol);
  while (symbol==' ')
                   {
                     original.get(symbol);
                       }
               for (symbol=='&lt;')
                 {
                   corrected.put('&gt;');
                   original.get(symbol);
                 }
               corrected.put(symbol);
             }
  }
       if (symbol=='o')
         {
           corrected.put(symbol);
           original.get(symbol);
           if (symbol=='u')
             {
               corrected.put(symbol);
               original.get(symbol);
               if (symbol=='t')
                 {
                   corrected.put(symbol);
                  original.get(symbol);
                   while (symbol==' ')
                     {
                       original.get(symbol);
                     }
                   for (symbol=='&gt;')
                     {
                       corrected.put('&lt;');
                       original.get(symbol);
                     }
                   corrected.put(symbol);
                 }
             }
         }
     }
   else
     corrected.put(symbol);
    }
   return;
  }
  </code></pre>
  
  <p>When I try to compile this code I get the following errors:</p>
  
  <blockquote>
    <blockquote>
      <p>operators.cpp:59:23: error: expected ‘;’ before ‘)’ token
             for (symbol=='&lt;')
                             ^ operators.cpp:65:5: error: expected primary-expression before ‘}’ token
           }
           ^ operators.cpp:65:5: error: expected ‘)’ before ‘}’ token > >operators.cpp:65:5: error: expected primary-expression before ‘}’
      token 
      operators.cpp:65:5: error: expected ‘;’ before ‘}’ token
      operators.cpp:83:20: error: expected ‘;’ before ‘)’ token
          for (symbol=='>')
                          ^ operators.cpp:89:9: error: expected primary-expression before ‘}’ token
               }
               ^ operators.cpp:89:9: error: expected ‘)’ before ‘}’ token operators.cpp:89:9: error: expected primary-expression before ‘}’
      token operators.cpp:89:9: error: expected ‘;’ before ‘}’ token</p>
    </blockquote>
  </blockquote>
  
  <p>I am kind of new to programming and have spent a couple of hours trying to fix it but I don't understand what the problem is.</p>
  
  <p>Any kind of help is greatly appreciated!</p>