The maximum sum is the result from adding the largest and next to largest number in the array. Demonstrating this is not so hard. To find the forementioned numbers you need to use the following algo:
if the first element in the array is greater than the second
the first element becomes the current largest number
the second element becomes the current next to largest number
else
the first element becomes the current next to largest number
the second element becomes the current largest number
for each element in the array after the second
if the element is greater than the largest number so far
the largest number so far becomes the new next to largest number
the current element becomes the new largest number
Of course, you have to track (record) not only the values, but also the indexes for the two largest numbers you have found.
Regards
EDIT: This is all assuming that you need to create your own algorithm. Otherwise, you can always use the nth_element routine. It can position the two largest elements at the beginning of the array for you. (It will be slower in this particular case.) Ask about it, if you think that you are permitted to directly apply STL for the solution.
http://www.cplusplus.com/reference/algorithm/nth_element/