ok, so either the statement that created ms2 above had a problem (perhaps arr has a problem) OR it is the wrong type of parameter or something for the call. Not sure, I don't speak the xor dialect of c++ (IS this c++?!) , but that is my best guess on where to start looking.