When you initialize an array, you can assign multiple values to it in one spot:
int array [] = {1,3,34,5,6};
... but what if the array is already initialized and I want to completely replace the values of the elements in that array in one line:
int array [] = {1,3,34,5,6};
array [] = {34,2,4,5,6};
This doesn't seem to work. Is there a way to do so?
std::copy(std::begin(newarr), std::end(newarr), std::begin(array));
would be better, wouldn't it? – Fleck