title: Passing Array of Objects to Another Class in C++
body: <p>I created a base class and an array of that class.  I am trying to pass this array to another class.  What am I doing wrong?  Is there a more elegant method of accomplishing this? </p>
  
  <pre><code>class WaypointClass
  {
  private:
      float latitude, longitude;
  public:
      WaypointClass(int lt, int lg)
      {
          latitude = lt;
          longitude = lg;
      }
  };
  
  class WaypointList
  {
  private:
      int currentWaypoint;
      WaypointClass *waypointList;
  
  public:
      WaypointList(WaypointClass *waypoints)
      {
          waypointList = &amp;waypoints;
          currentWaypoint = 0;
      }
  };
  
  const WaypointClass waypoints[] =
  { WaypointClass(1, 2), WaypointClass(3, 4), WaypointClass(5, 6) };
  
  WaypointList myWaypoints(&amp;waypoints);
  </code></pre>