It does not copy the array; he turns it into a pointer. If you change it, you yourself will see:
void f(int x[]) { x[0]=7; } ... int tst[] = {1,2,3}; f(tst);
If you need to copy an array, use std::copy :
int a1[] = {1,2,3}; int a2[3]; std::copy(std::begin(a1), std::end(a1), std::begin(a2));
If you do this, you can use std::array .
refi64
source share