0
I would like to do the allocation operator’s Overload (operator=
), I know I have to reserve memory, and copy data from one to the other, however I do not know how to copy one vector to the other without knowing the size of the same.
class Perfil{
private:
char letra;
vector <Carateristica*> carateristicas;
}
Perfil & Perfil::operator=(const Perfil & p1)
{
letra = p1.getLetra();
// Agora deveria reservar memoria utilizando o new
// e copiar os dados de um vector para o outro
(..)
}
The operator '=' returns a copy of the vector ...
– Felipe