Using Reduce With Array Of Pointers In Cpp