In my header file, I have the following code
class ExEvent : public Event {
public:
ExEvent(
Item* dst[SIZE],
);
~ExEvent();
Item* dst[SIZE];
};
In the cpp file, I have the following code
ExEvent::ExEvent(
Item * dst[SIZE],
) : Event() {
this->dst = &dst;
}
I get the following error:
error: array type 'Item *[15]' is not assignable
this->dst = &dst;
Can someone explain why this error happens and why I cannot assign dst array pointer to this->dst.
std::copyinstead, or even better usestd::arrayin 1st place.this->syntax by giving your parameters different names than your member variables.