Hi all,
Is there any way to get a pointer to a vector (or the vector itself) if you
only have an iterator of it? Something like this:
DoSomething(vector<double>::iterator x)
{
vector<double> *q;
//do something to x so that this works
q=x.GiveMeAPointerToTheVector(please);
}
And another, somewhat related question:
The basics:
class Test
{
public:
double d;
void DoSomething(double t);
};
Now in another file I do:
vector<Test> x;
than I push_back lots of stuff into x and at one point do
x.DoSomething(double t);
Now in the function DoSomething, can I use 'this' in a nifty way to get a
pointer to the vector x?
Something like
void DoSomething(double t)
{
vector<Test> *q;
q=this->SomeNiftyThings();
}
Thanks for any help!
Jens