0

Hello,

I'm just wondering how you return a vector from a member function. I've looked online but had no luck. At the moment my function is set to long double, and when I tried setting it to std::vector it came up with lots of errors. Here is my code:

```
public:
long double evalx(vector<long double>, vector<long double>, vector<long double>);
.....
......
long double IFS::evalx(vector<long double> x, vector<long double>a, vector<long double>b)
{
a[0] = 1.0;
b[0] = 1.0;
for(int i=1; i<=1; ++i)
{
a[i] = (matrix[0]*a[i-1] + matrix[1]*b[i-1] + matrix[2]);
}
x.push_back(a[i+1]);
return x;
}
```

It is telling me

error:: cannot convert 'std::vector<long double>' to 'long double' in return

which makes sense, I just don't know how to tell it to return a vector. Sorry I'm still very new to c++. Any help would be gratefully received. Thank you.

*Edited 5 Years Ago by megaLU*: n/a