I have to call a function in the form f(void* params)
I would like to pass two vector<double> to this function.
I suppose I should make a struct
struct MyParam_t {
vector<double> myvector1;
vector<double> myvector2;
};
and then somehow fill it and pass it to the function. Someone recommended that I use this:
struct MyParam_t {
vector<double> *myvector1;
vector<double> *myvector2;
};
but i'm not really sure the difference. Can someone explain how I would fill this struct - My guess was
vector<double> a;
a.push_back(0);
MyParam_t MyParam;
MyParam.myvector1 = a;
f(MyParam)
but it doesn't work.
Also, then when I am in the function and have a variable of type void* called params, how do i get back my variable of type MyParam_t?
Thanks!
Dave