I’m trying to create a dynamic array of objects, similar to ArrayLists in Java. I’m new at C++ and can’t get it to work.
class Album{
private:
public:
void addPhoto(Photo p){
}
};
What should my private datamember look like and how do I add p to it? And do I need a pointer for some reason?
The functionality you look for already exits in the stl collection classes and and with out knowing you application it would be had to tell you weather you needed a pointer or not.
The basic layout of you underlying container could be something like this.