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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -