title: map undeclared : first use in the function error
body: <pre><code>#include&lt;stdio.h&gt;
  #include&lt;map&gt;
  
  int main()
  {
      int cases, i, j, act, answer, min_ind, min_val, temp1, temp2;
      scanf("%d",&amp;cases);
  
      for(i=0; i&lt;cases; i++)
      {
          answer = 0;
          scanf("%d", &amp;act);
          map&lt;int, int&gt; mymap;
  
          for(j=0; j&lt;act; j++)
          {
              scanf("%d",&amp;temp1);
              scanf("%d",&amp;temp2);
              mymap[temp2] = temp1;
          }
  
          map&lt;int,int&gt;::iterator it = mymap.begin();
          temp1 = it-&gt;second;
  
          while(mymap.size() != 0)
          {
              it = mymap.begin();
              if(it-&gt;second &lt; temp1)
              {
                  mymap.erase(it);
                  continue;
              }
  
              answer++;
              temp1 = it-&gt;first;
              mymap.erase(mymap.begin());
  
              if(mymap.size() != 0)
              {
                  it = mymap.begin();
                  while(it-&gt;second &lt; temp1)
                  {
                      mymap.erase(it);
                      it = mymap.begin();
                  }
              }
          }
  
          printf("%d\n",answer);
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I have included the map header as per the STL of C++ but still its not compiling and giving compilation error. I have tried including map.h header file but still getting the same error</p>
  
  <p>Error:</p>
  
  <pre><code>prog.cpp: In function 'int main()':
  prog.cpp:13: error: 'map' was not declared in this scope
  prog.cpp:13: error: expected primary-expression before 'int'
  prog.cpp:13: error: expected `;' before 'int'
  prog.cpp:19: error: 'mymap' was not declared in this scope
  prog.cpp:22: error: expected primary-expression before 'int'
  prog.cpp:22: error: expected `;' before 'int'
  </code></pre>
  
  <p>Have a look at my code and help me out with this. Thanks for any help in advance.</p>