Code fixes

I poked at the code some more and found the error. Apparently std::copy doesn't like 2D arrays. I changed it to use the raw memory addresses of the arrays, which compiles and runs without error. Also, the for loop you have commented out doesn't initialize the last element of ip, which causes the program to request something at a negative memory address, which fails spectacularly. That's probably where your segfault was coming from.