The partial sum function replaces the kth entry of the array with the sum of that entry and all previous entries. This operation is performed in-place.
void partial_sums( int array[], std::size_t capacity );
template <typename T> void partial_sums( T array[], std::size_t capacity );