I am trying to return a vector of structs from my class, but am getting a few errors. This is what i have setup so far:
class trial{
public:
struct coords{
double x,y,z;
};
vector<coords> trial::function(vector <double> x1, vector <double> x2);
};
std:vector<coords> function(vector <double> x1, vector <double> x2){
some math.....
vector <coords> test;
return test;
}
The error comes at the st::vector.... saying coords was not defined. Any thoughts?
You mean, in out-of-class definition? It should be (provided you're using std::vector;
)
vector<trial::coords> trial::function(vector <double> x1, vector <double> x2){
In in-class declaration earlier, qualification trial::
is not needed.