Write a function int sumArray(int* arr, int size) that adds up all elements in an array using pointer arithmetic. Don't use array indices at all. Start with int* ptr = arr and use ptr++ to move through elements.
Your loop should look like: for(int i = 0; i < size; i++) { sum += *ptr; ptr++; }. This dereferences the current position, adds that value to sum, then moves the pointer forward. Test with an array like int nums[] = {1, 2, 3, 4, 5}.
Calling sumArray(nums, 5) should return 15. This problem helps you understand that arrays and pointers work together naturally.