Original Post
Although the title is vague, have no fear, i will explain it now. I've been trying to get this class to work, i'm trying to make a vector pointer inside a class to point to a given vector outside the class. This is C++, it looks something like this. ...yea i'm using SDL too, the error for this is: 'push_back' has not been declaired request for member of non-aggregate type before '(' token Am i allowed to resize a pointer? I don't know what the problem is atall. - i am including all the right header files and i deleted some irrelevant stuff from the class to make it easier to see. Thanks for any help :)
class CTile
{
private:
vector<SDL_Rect> * Colpix;
public:
CTile( int x, int y, vector<SDL_Rect> BoxType );
};
CTile::CTile( int x, int y, vector<SDL_Rect> BoxType )
{
for( int i = 0; i < BoxType.size(); i++ )
{
*Colpix.push_back( &BoxType );
}
}