title: g++ error: stray '\177' in program
body: <p>I was trying to code for following program</p>
  
  <blockquote>
    <p>Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).</p>
    
    <p>You may assume that the intervals were initially sorted according to their start times.</p>
    
    <p>Example 1:</p>
    
    <p>Given intervals [1,3],[6,9] insert and merge [2,5] would result in [1,5],[6,9].</p>
    
    <p>Example 2:</p>
    
    <p>Given [1,2],[3,5],[6,7],[8,10],[12,16], insert and merge [4,9] would result in [1,2],[3,10],[12,16].</p>
  </blockquote>
  
  <p>This is the relevant part of my program
  here. I want to erase the few positions from the vector
  then I am getting the following error</p>
  
  <pre><code>error: stray '\177' in program
  
       intervals.erase(intervals.begin()+(p+1),intervals.begin()+(q+1)); 
  </code></pre>
  
  <hr>
  
  <pre><code> vector&lt;Interval&gt; Solution::insert(vector&lt;Interval&gt; &amp;intervals, Interval newInterval) {
  
  int n = intervals.size();
  int p=-1,q=-1,a,b;
  
  for(int i=0;i&lt;n;++i){
      if(intervals[i].start &lt;= newInterval.start &lt;= intervals[i+1].end)
          p = i;
      else if(intervals[i].end &lt; newInterval.start &lt; intervals[i+1].start)
          a = i;
  
  
      if(intervals[i].start &lt;= newInterval.end &lt;= intervals[i+1].end)
          q = i;
      else if(intervals[i].end &lt; newInterval.end &lt; intervals[i+1].start)
          b = i;
  
  }
  int x,z;
  
  if(p != -1 &amp;&amp; q != -1)
      x = q-p;
  
  if(x &gt; 0){
      z=intervals[q].end;
      intervals.erase(intervals.begin()+(p+1),intervals.begin()+(q+1));
      intervals[p].end = z;
  }
  return vector
  }
  </code></pre>