1

I have just configured c/c++ in netbeans on ubuntu and when i try to use std::pair it seems that the compiler cannot find it that is very strange the default version of c++ is c++11 that a slice of my code

int n, k;
cin >> n>>k;
vector<pair<int,int> > x(n);

thanks in advance

Mohammad Shaban
  • 176
  • 1
  • 16

1 Answers1

3

You need to include the right header files a the beginning of your source files so that the compiler know the different types/objects:

#include <iostream> // For std::cin
#include <vector>   // For std::vector
#include <utility>  // For std::pair

And use the std namespace by default if you want (before main() typically):

using namespace std;
Pierre
  • 1,162
  • 12
  • 29