I'm a beginner with C++ and I'm currently trying to compile an easy program with Geany, but it doesn't recognize the type 'auto' because it's a C++11 extension, and then when execute the terminal shows this message: No such file or directory
this is the code
#include <iostream>
#include <array>
using namespace std;
typedef int type;
typedef array <type, 6> List;
bool belong(type element, List list);
int main()
{
List mylist = {1,2,3,4,5,6};
cout << belong(2, mylist) << endl;
cout << belong(16, mylist) << endl;
return 0;
}
bool belong(type x, List list)
{
for (auto element : list){
if (x==element) return true;
}
return false;
}
Can someone help me.