Q:

How to clone objects of unknown dynamic type in C++? 

I want to build an array of dervied class objects.  I have this base class:
class CandyBox {
protected:
    string flavor;
    string origin;
public:
    inline CandyBox();
    inline CandyBox(string s1, string s2);
    virtual float getVolume() = 0;
    virtual void toString();
    CandyBox& operator=(const CandyBox& obj);
    virtual ~CandyBox() {}
};

And 2 derived class named class Lindt and class ChocAmor with constructors and methods as well.  I'm trying to build now a scratchy list like this:
CandyBox** vec = new CandyBox*[n];

for (int i = 0; i < n; i++) {
    cin >> type;
    if (strcmp(type, "ChocAmor") == 0) {
        vec[i] = new ChocAmor(1, "s", "ro");
    }
    else vec[i] = new Lindt(1, 2, 3, "f", "it");
}

My question is: What if I want to make another class named CandyBag that contains an attribute like this one CandyBox** vec = new CandyBox*[n]; and I need this method:
CandyBag& operator=(const CandyBag& candy) {
    ChocAmor::operator=(candy);
    Lindt::operator=(candy);
    dim_max = candy.dim_max;
    current_dim = candy.current_dim;
    vec = new CandyBox*[candy.dim_max];

    for (int i = 0; i <= current_dim; i++) {
        vec[i] = new ; //HERE I'M STUCK
        // because I can't just simply write vec[i] = candy.vec[i], right? 
        // I need to allocate memory for that vec[i] first
    }
    return *this;
}

I'm not sure how can I allocate memory for that vec[i] if I don't know the type (if it's a ChocAmor object or a Lindt type in that candy.vec[i]).  Should I get an auxiliar array where I should store the types of that array? 

A:

All pointers to class-type are the same size and representation.  That is essential for opaque pointers to work at all. 
If you want to enable cloning the pointed-to objects, add a virtual .clone() to the interface, and/or write your own copying smart-pointer. 
Lugging around a pointer to a clone-function or maintaining a mapping from typeid to clone-function would be far more cumbersome, though can be the right solution in other circumstances. 
Otherwise, I have a suggestion:
Use smart-pointers, preferably std::unique_ptr, and standard containers, preferably std::vector, to avoid manual memory-management and gain all the associated benefits of using standard types.