title: Stuck on C++ code using Structure
body: <p>Currently I am stuck and not sure where to go from here...</p>
  
  <p>I'm supposed to write a program that declares a struct to store the data for a player. Then declare an array of 10 components to store the data for 10 baseball players. </p>
  
  <p>The program reads from a file and stores the data for ten baseball players, including player’s team, name of player, number of homeruns, batting average, and runs batted in. </p>
  
  <p>The program prints out a menu (in a loop, so this can be done again and again) giving the user a choice to:</p>
  
  <ul>
  <li>print out all users and statistics</li>
  <li>print out the statistics for a specific player</li>
  <li>print out all data for a specific team</li>
  <li>update the data for a particular player (change one of the statistics)</li>
  </ul>
  
  <p>Before the program terminates, give the user the option to store the data in an output file.</p>
  
  <p>If anyone has ANY TIPS OR ADVICE I will be very grateful... I'm fairly new to coding in C++ and just stuck here... thank you in advance...</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  struct BaseballID
  {
      string teamName, playerFirstName, playerLastName;
      int homeRuns, rbi;
      double batting_average;
  };
  
  int main()
  {
      BaseballID listofplayers[10];
      ifstream infile;
  
      infile.open("/users/AlecKleyer/Desktop/computer science term 2/BaseballStats.txt");
  
      if (!infile)
      {
          cout &lt;&lt; "Error opening file!";
          return 0;
      }
  
      for (int j = 0; j &lt; 10; j++) {
          infile &gt;&gt; listofplayers[j].teamName &gt;&gt; listofplayers[j].playerFirstName &gt;&gt; listofplayers[j].playerLastName &gt;&gt;listofplayers[j].homeRuns &gt;&gt; listofplayers[j].rbi &gt;&gt; listofplayers[j].batting_average;
      }
      cout &lt;&lt; "Please Type The Following Letter: ";
      cout &lt;&lt; "\n(A) For All Users and Stats";
      cout &lt;&lt; "\n(B) For A Specific Player";
      cout &lt;&lt; "\n(C) Print out for specific team";
      cout &lt;&lt; "\n(D) Update stats for a player";
  
      char input = 0;
      cin &gt;&gt; input;
  
      if (input == 'A' || input == 'a') {
          printInfoAll(*listofplayers[]);
      }
      if (input == 'B' || input == 'b') {
  
      }
      if (input == 'C' || input == 'c') {
  
      }
      if (input == 'D' || input == 'd') {
  
      }
  
  }
  
  void printInfoAll(listofplayers1[])
  {
      for (int i = 0; i &lt; 10; i++) {
          cout &lt;&lt; &amp;listofplayers[i];
      }
  }
  </code></pre>