this is basically what I am trying to do:
class Player
{
public:
void setInventory(string inventory[]) { this->inventory = inventory; }
private:
string inventory[4];
};
normally I would use strncpy(); but sadly using the parameter inventory[] as the source does not work because it isn't a const char *. I want to keep this as an in class function if possible in one or two lines. I just want to know if there is a short way of doing this rather than creating a function outside of the class for it. Thanks
std::array. Or aboutstd::copy.