This is C++, you should be using new not malloc. This will allow you to remove that nasty cast. Casts should be avoid if possible, basically a cast (especially a C style cast) short circuits all your compilers type checking which is bad.
In you loop CSPair-> always references the first item in the array. Basically you put data into the first item in the array 10 times but never put anything into items 1 - 9.
The magic number 10 appears all over you code. Avoid magic numbers, define a const somewhere and use that.
Personally I would typedef rather than #define my integer types.