With pointers and on a sorted array: If : move right. The sum is too small, and moving increases it.
If : move left. The sum is too big, and moving decreases it. If they're equal: you found the answer.
Each step eliminates at least one element from consideration. After at most steps, you've checked all possibilities.