In this video, we're going to look at an example of a function that sums the elements of an array and uses pointer manipulation to access those elements. As always, we begin in main. The first thing we're going to do is declare and initialize an array of four elements. We put them in main's frame with four boxes, one that holds four, one that holds six, one that holds eight, and one that holds three. Now we call the function sum array passing in data, which is a pointer to that array and four as the number of elements. Inside sum array, we declare a variable answer which equals zero, and int * pointer which points at the same place as the array parameter passed in. Notice, we have three arrows all pointing at the beginning of this array. Now, we're going to begin a for loop. We go inside that, and have i equals zero, we're going to say, answer plus equals star pointer. Star pointer is the box pointed to by pointer which is this int here, four. So, we're going to do zero plus four is four, and change answer to be four. Now, we're going to increment pointer, doing a little bit of pointer arithmetic which is going to make pointer point at the next box in the array, one int later. We go around our for loop again, i is now one, and we go inside. Star pointer is now the box with six in it, so answer is four plus six which is 10. We increment pointer again, pointing it at the next box for an int, and we go through our loop again. Star pointer is 8, 10 plus 8 is 18, and we increment pointer. We enter the loop again. Answer is 18 plus 3 which is 21. We increment pointer to be something, it's past the bounds of data and we might wonder if this is a problem. Well, this is only a problem if we dereference pointer because we wouldn't actually know which box it's pointing at. It could be pointing at sum, it could be pointing at the return address for main, it could be pointing at the return address for some array, it could be pointing at anything, including something that is not actually a box we've drawn here. Maybe just some other space where the compiler needed to put things in memory. It's okay to have an arrow pointing here past the bounds of the array, but we should not say, star pointer while we do that. In this case, we've just finished our for loop, so it's not going to matter because we're going to return our answer 21 back to main, and destroy some arrays frame so that variable and pointer are going to go away without us ever having dereferenced it. We print our answer which is 21 and we return.