I have included the STL library in Arduino and i can run a program with 1D vector. But i am getting error while declaring a 2D vector.
#include <StandardCplusplus.h>
#include <serstream>
#include<vector>
#include<iterator>
using namespace std;
vector <vector<int> > grid;
vector<int> col(5,3);
grid.push_back(col);
void setup()
{
Serial.begin(9600);
}
void loop()
{
for(int i = 0; i < 5; i++)
{
Serial.println(grid[[0][i]);
}
}
And the error is
'grid' does not name a type.
Do i need to add another header file?