title: cannot convert <int*, std::vector<int> >’ to ‘int*'
body: <p>I am trying to find lower and upper bound of an element by using pair.first and pair.second</p>
  
  <p>I am getting following error while compiling using gcc:</p>
  
  <pre><code>zco.cpp: In function ‘int main()’:
  zco.cpp:136:47: error: cannot convert 
  ‘__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;’ to ‘int*’ in 
  initialization
  int *a = lower_bound(x.begin(), x.end(),temp1);
                                             ^
  zco.cpp:137:47: error: cannot convert 
  ‘__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;’ to ‘int*’ in 
  initialization
  int *b = upper_bound(y.begin(), y.end(),temp2);
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>int main(){
      int N,X,Y;
      scanf("%d %d %d",&amp;N,&amp;X,&amp;Y);
      vector&lt; pair&lt;int,int&gt; &gt; n(N);
      for(int i=0;i&lt;N;i++){
          int temp1,temp2;
          scanf("%d %d",&amp;temp1,&amp;temp2);
          n[i] = make_pair(temp1,temp2);
      }
      vector&lt;int&gt; x(X);
      for(int i=0;i&lt;X;i++){
          scanf("%d",&amp;x[i]);
      }
      vector&lt;int&gt; y(Y);
      for(int i=0;i&lt;Y;i++){
          scanf("%d",&amp;y[i]);
      }
      stable_sort(n.begin(), n.end());
      stable_sort(x.begin(), x.end());
      stable_sort(y.begin(), y.end());
      int sum = 0;
      for(int i=0;i&lt;N;i++){
          int temp1 = n[i].first;
          int temp2 = n[i].second;
          int *a = lower_bound(x.begin(), x.end(),temp1);
          int *b = upper_bound(y.begin(), y.end(),temp2);
          sum += b-a+1;
      }
      printf("%d",sum);
  }
  </code></pre>
  
  <p>How can I solve this error. Please help me.</p>