title: Complie Error: could not convert
body: <p>I am trying to put a specific amount of movies the user enters to the array.
  Then I am going to use a pointer of arrays of class in a function as will be shown below</p>
  
  <p>When I compile my program, it gives me an error message saying
  "could not convert ' (MovieData*<em>) (&amp; pMovie)' from 'MovieData</em>*' to MovieData'</p>
  
  <p>My body</p>
  
  <pre><code>int amount = 0;
  cout &lt;&lt; "How many movies did you watch last month?";
  cin &gt;&gt; amount;
  
  MovieData *pMovie[amount];
  *pMovie = new MovieData[amount];
  
  cout &lt;&lt; "Please enter the information of your Movies!" &lt;&lt; endl;
  readMovieData(pMovie, amount);         //This line!
  
  cout &lt;&lt; "Here are the information with your Movies!" &lt;&lt; endl;
  MovieDatastats(pMovie, amount);        //This line!
  </code></pre>
  
  <p>and here are my functions </p>
  
  <pre><code>void readMovieData(MovieData *pMovie, int const size)
  {
  string title;
  string director;
  int year;
  int time;
  
  for(int i = 0; i &lt; size; i++)
  {
      cout &lt;&lt; "Please enter the Title of the movie.";
      getline(cin,title);
      pMovie[i].setTitle(title);
  
      cout &lt;&lt; "\nPlease enter the Director name of the movie.";
      getline(cin,director);
      pMovie[i].setDirector(director);
  
      cout &lt;&lt; "\nPlease enter the year it was released.";
      cin &gt;&gt; year;
          if(year &gt;= 1900 &amp;&amp; year &lt;= 2004)
              pMovie[i].setYear(year);
          else
          {
              cout &lt;&lt; "Please enter a year between 1900 and 2004." &lt;&lt; endl;
              year = 0;
          }
  
      cout &lt;&lt; "\nPlease enter the time the movie last.";
      cin &gt;&gt; time;
          if(time &gt; 0 &amp;&amp; time &lt; 14400)
              pMovie[i].setTime(time);
          else
          {
              time = 0;
              cout &lt;&lt; "Please enter a time between 0 and 14400 in minutes." &lt;&lt; endl;
          }
      }
  }
  </code></pre>
  
  <p>that is for my function to set the information into the private class</p>
  
  <p>and another function which is to play around with the information of the private class</p>
  
  <pre><code>void MovieDatastats(MovieData *pMovie, int const size)
  {
  float sumTime = 0.0;
  float averageTime = 0.0;
  for (int i = 0; i &lt; size; i++)
  {
      sumTime +=pMovie[i].getTime();
  }
  averageTime = sumTime/size;
  
  cout &lt;&lt; "Your average time of all your movie is: " &lt;&lt; averageTime &lt;&lt; endl;
  
  int oldYear = 0;
  int count = 0;
  int recentYear = 0;
  int counter = 0;
  
  oldYear = pMovie[0].getYear();
  recentYear = pMovie[0].getYear();
  
  for (int j = 1; j &lt; size; j++)
  {
      if(pMovie[j].getYear() &lt; oldYear)
      {
          oldYear = pMovie[j].getYear();
          count = j;
      }
      else if(pMovie[j].getYear() &gt; recentYear)
      {
          recentYear = pMovie[j].getYear();
          counter = j;
      }
  }
  
  cout &lt;&lt; "The oldest Movie you have watched is called..." &lt;&lt; endl;
  cout &lt;&lt; "Title: " &lt;&lt; pMovie[count].getTitle() &lt;&lt; endl;
  cout &lt;&lt; "Director: " &lt;&lt; pMovie[count].getDirector() &lt;&lt; endl;
  cout &lt;&lt; "Release Year: " &lt;&lt; pMovie[count].getYear() &lt;&lt; endl;
  
  cout &lt;&lt; "The most newest Movie you have watched is called..." &lt;&lt; endl;
  cout &lt;&lt; "Title: " &lt;&lt; pMovie[counter].getTitle() &lt;&lt; endl;
  cout &lt;&lt; "Director: " &lt;&lt; pMovie[counter].getDirector() &lt;&lt; endl;
  cout &lt;&lt; "Release Year: " &lt;&lt; pMovie[counter].getYear() &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Also, how do I delete the allocated memory and set the pointer to point at NULL?</p>