my = s can be changed to: memcpy(my,s, sizeof(int)*9); //9 is 3*3.
memcpy will work here, but if you change to ** or objects instead of integers or anything fancy you should use a loop to copy it manually or provide iterators so you can use std::copy.