c++ - How to declare a vector of structure of a class -
i have class structure in it. how create vector of structure type?
here example:
class { public: struct mystruct { mystruct (int _label, double _dist) : label(_label), dist(_dist) {} int label; double dist; }; }
now in class "a" there function below.
myfunc ( vector<mystruct> &mystry );
so question need call function vector of structure. how can declare this?
use scope operator ::
:
std::vector<a::mystruct>
Comments
Post a Comment