title: expected initializer before ‘&’ token
body: <p>I wrote a simple example which came from the book "The C++ Programming.Language.4th.Edition"</p>
  
  <pre><code>#include &lt;ostream&gt;
  
  struct Entry{
    string name;
    int number;
  }
  
  ostream&amp; operator&lt;&lt;(ostream&amp; os, const Entry&amp; e){
     return os &lt;&lt; "{\"" &lt;&lt; e.name &lt;&lt; "\"," &lt;&lt; e.number &lt;&lt; "}";
  }
  
  int main()
  {
    Entry a;
    a.name = "Alan";
    a.number = "12345";
    return 0;
  }
  </code></pre>
  
  <p>The g++ returned an error message while compiling
  error: expected initializer before ‘&amp;’ token</p>
  
  <p>ps: the &amp; token mentioned above belongs to the ostream&amp; operator</p>
  
  <p>could anyone give a clue ?</p>