title: Why does THIS code work but THAT one doesn't?
body: <p>Language C++
  Here's the complete code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  struct part
  {
  int model_numb;
  int part_numb;
  float cost;
  };
  
  void main()
  {
  part part1, part2 = { 2022, 203, 2121.23F };
  char dummy;
  
  part1.model_numb = 12345;
  part1.part_numb = 203;
  part1.cost = 5050.30F;
  
  cout &lt;&lt; "******Part1*****" &lt;&lt; endl;
  cout &lt;&lt; "\nModel Numb: " &lt;&lt; part1.model_numb
      &lt;&lt; "\nPart Numb: " &lt;&lt; part1.part_numb
      &lt;&lt; "\nCost: " &lt;&lt; part1.cost &lt;&lt; endl &lt;&lt; endl;
  
  cout &lt;&lt; "******Part2*****" &lt;&lt; endl;
  cout &lt;&lt; "\nModel Numb: " &lt;&lt; part2.model_numb
      &lt;&lt; "\nPart Numb: " &lt;&lt; part2.part_numb
      &lt;&lt; "\nCost: " &lt;&lt; part2.cost &lt;&lt; endl &lt;&lt; endl;
  
  part1 = part2;
  
  cout &lt;&lt; " part1 = part2" &lt;&lt; endl &lt;&lt; endl;
  
  cout &lt;&lt; "******Part1*****" &lt;&lt; endl;
  cout &lt;&lt; "\nModel Numb: " &lt;&lt; part1.model_numb
      &lt;&lt; "\nPart Numb: " &lt;&lt; part1.part_numb
      &lt;&lt; "\nCost: " &lt;&lt; part1.cost &lt;&lt; endl &lt;&lt; endl;
  
  cout &lt;&lt; "******Part2*****" &lt;&lt; endl;
  cout &lt;&lt; "\nModel Numb: " &lt;&lt; part2.model_numb
      &lt;&lt; "\nPart Numb: " &lt;&lt; part2.part_numb
      &lt;&lt; "\nCost: " &lt;&lt; part2.cost &lt;&lt; endl &lt;&lt; endl;
  
  
  cin &gt;&gt; dummy;
  }
  </code></pre>
  
  <p>If I replace the following line:</p>
  
  <pre><code>part part1, part2 = { 2022, 203, 2121.23F };
  </code></pre>
  
  <p>with these lines:</p>
  
  <pre><code>part part1, part2;
  part2 = { 2022, 203, 2121.23F };
  </code></pre>
  
  <p>the code won't work. It gives me syntax errors ( missing ';' before '{' ) ( missing ';' before '}') and (expected an expression) at those lines. Whyy??? I'm sure I've made no changes to the second program, except for the ones mentioned. </p>