Can you tell me, how to pass a reference to the column in 2d vector to function with following declaration:
void SetData( const std::vector<float> &xs,const std::vector<float> &ys); This function is from wxMathPlot.
My vector's declaration looks like this:
vector<vector <double> > sekce(8); vector<vector<time_t> > cas_t_all(8);
I would like to do something like this(doesn't work):
plot->SetData( &(float)cas_t_all, &sekce); = pass second column of vector cas_t_all and fifth column of vector sekce to funkcion SetData(...). Issue here is also type casting - this I can avoid by my working code - see lower.
Current situation is that I have to copy whole column from vector cas_t_all to new vector xs and column from vector sekce to new vector ys:
std::vector<float> xs,ys; for ( int i = 0; i < sekce.size(); i++ ) xs.push_back(cas_t_all[i]); ys.assign(sekce.begin(),sekce.end()); plot->SetData( xs, ys);
Thanks in advance.