Hi,
I have a two dimensional vector and I am trying to access all the elements of one row at a time. I am getting a syntax error. Following is my code :
std::vector<int> row;
std::vector<std::vector<int> > event(5,row);
for(lv = 0; lv < 5; lv++)
{
for(int gno=event[lv].begin; gno != event[lv].end(); gno++)
{
//doing something
}
I am getting the following error while compiling:
error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >' to 'int' in initialization
error: no match for 'operator!=' in 'gno != (+ event_gate. std::vector<_Tp, _Alloc>::operator[] [with _Tp = std::vector<int, std::allocator<int> >, _Alloc = std::allocator<std::vector<int, std::allocator<int> > >](((long unsigned int)(lv / 5))))->std::vector<_Tp, _Alloc>::end [with _Tp = int, _Alloc = std::allocator<int>]()'
Please help! I am really stuck
Thanks