Hi I've got my World class returning a pointer to a vector array of the Smoke class:
class Smoke {
public:
D3DXVECTOR3 position;
};
class World {
private:
vector<Smoke> smokes;
public:
vector<Smoke>* getSmokes() {
return &smokes;
}
And I when trying to access the get function, I get an error eg:
D3DXVECTOR3 p = world->getSmokes()[0].position;
returns the error:
Quote:
error C2039: 'position' : is not a member of 'std::vector<_Ty>'
with
[
_Ty=Smoke
]
I don't see whats wrong here, and are there any alternate ways of returning the array that you would recommend?