title: error: expected unqualified-id before '{' token
body: <p>I'm a newb to C++ and I get the following error. I looked up similar topics, but didn't find the answer I need. Here is the script, the error is in line 23:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  struct rendeles {
      string nev;
      int mennyiseg;
  };
  
  struct teaceg {     
      string nev;
      int mennyiseg;
  };
  
  int szam; 
  
  int hanyadikceg (string cegnev); 
  {            //line 23
      for (int i=0;i&lt;szam;i++)
      {
          if (cegek[i].nev==cegnev)
              {
                  return i;
              }
      }
      return -1;
  }
  
  void osszesit()
  {
      for (int i=0;i&lt;szam;i++)   
      {
  
      }
  }
  
  int main()
  {
      cout &lt;&lt; "Hány db rendelés lesz összesen?";
      cin &gt;&gt; szam;
  
      struct teaceg cegek [szam];
      struct rendeles rendelt [szam];     
  
      for (int i=0;i&lt;szam;i++)          
      {
          cout &lt;&lt; "A(z) " &lt;&lt; i+1 &lt;&lt;". cég neve:";
          cin &gt;&gt; rendelt[i].nev;
          cout &lt;&lt; "A(z) " &lt;&lt; i+1 &lt;&lt;". rendelés mennyisége:";
          cin &gt;&gt; rendelt[i].mennyiseg;
      }
  
      cout &lt;&lt; endl;
      for (int i=0;i&lt;szam;i++) 
      {
          cout &lt;&lt; "A(z) " &lt;&lt; i+1 &lt;&lt; ". rendelés: " &lt;&lt; rendelt[i].nev &lt;&lt; " " &lt;&lt; rendelt[i].mennyiseg &lt;&lt; endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Sorry for the foreign identifiers :-)</p>
  
  <p>Thanks for all the help! Such a newbie mistake :-) </p>
  
  <p>I still have a problem though: I want "cegek" and "rendelt" be dynamic arrays. So they can't be global variables. But in the function "hanyadikceg" I need to get their data. Could you show me pls how to pass the variables to the function properly? (what to write inside the "()" of the function "hanyadikceg") Thanks!</p>