c++ - why cannot find std::pair in netbeans on ubuntu -


i have configured c/c++ in netbeans on ubuntu , when try use std::pair seems compiler cannot find strange default version of c++ c++11 slice of code

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

thanks in advance

you need include right header files beginning of source files compiler know different types/objects:

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

and use std namespace default if want (before main() typically):

using namespace std; 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -