title: Creating an array of structs in C++
body: <p>I'm working on an assignment that requires me to use an "<em>array of structs</em>". I did this once before for another assignment for this prof, using this code:</p>
  
  <pre><code>struct monthlyData {
      float rainfall;
      float highTemp; 
      float lowTemp;  
      float avgTemp;  
  } month[12];
  </code></pre>
  
  <p>Which got the job done fine, but I got points marked off for the array being global. What should I do instead to avoid that? I haven't touched C++ at all over the summer, so I'm pretty rusty on it at the moment and have no clue where to start for this one.</p>