title: C++ Structure Declaration and usage compiler error
body: <p>Here is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  struct product {
    int weight;
    float price;
  } apple, banana, melon; // can I declare like this ?????
  
  int main()
  {
    apple a;
  
  }
  </code></pre>
  
  <p>When I compiled this sample, the compiler says:</p>
  
  <pre><code>struct.cpp|11|error: expected ';' before 'a'|
  </code></pre>
  
  <p>Same thing works fine in C language ...</p>
  
  <p>What's wrong?</p>