That actually compiles? Your functions don't match your prototypes, and C++ really shouldn't allow you to assign an int to an int*.
It's not crashing because the size is incorrect (although it is), because you never read from the array.
I'd start by writing just one of the cases (say the...