This is not intended answer to this question, but for proper cpp code of divide and conquire for maximum subarray sum problem you can read ans understand this solution.
Solution link : https://leetcode.com/problems/maximum-subarray/solutions/6598533/real-divide-and-conquire-for-future-self-5cvt