title: How to get subarray of C-Array
body: <p>I am trying to find out what is the easiest way to get a subset of C-Array if there are start and end points give.</p>
  
  <p>Example: I have a class Trip:</p>
  
  <pre><code>class Trip
  {
    private:
    char* final_destination;
    char* description;
    public:
    //all constructors, operators and stuff
  };
  </code></pre>
  
  <p>And, lets say I have an array of Trips:</p>
  
  <pre><code>Trip* trips = new Trip[10];
  </code></pre>
  
  <p>I am trying to write a function that takes the Trip array, starting point(given destination), end point(given destination) and return a subset of type Trip*.</p>
  
  <p>E.g.</p>
  
  <pre><code>Trip* GetSubTrip(Trip* trips, char* start_point, char* end_point)
  {
    //Logics that returns Trip*
  }
  </code></pre>
  
  <p>In other words, If I had: </p>
  
  <pre><code>[{"London", "Big Ben"}, {"New York", "Manhattan"}, {"Paris", "Eifell Tower"}, {"Moscow", "Lots of fun"}] 
  </code></pre>
  
  <p>That would be the <strong>Trip* trips</strong> and "New York" as a start and "Moscow" as an end passed to the <strong>GetSubTrip</strong> I am trying to make it return Trip*.</p>
  
  <p>And the return has to be: </p>
  
  <pre><code>[{"Paris", "Eifell Tower"}, {"Moscow", "Lots of fun"}] 
  </code></pre>
  
  <p>What I do is:</p>
  
  <ol>
  <li>In an integer counter I get the length between start and end</li>
  <li>Create a new pointer Trip* and assign it with length of the counter from 1</li>
  <li>Iterate over the 'trips' parameter and keeping a track if I am between start and end and if yes-> add the object to the result else procceed further. </li>
  </ol>
  
  <p>But this is a lot of code. I am sure that there is much easier way.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>It has to be done WITHOUT the use of VECTOR!</strong></p>