In this lecture, we'll explore the pass by value mechanism that C ++ uses by default for functions with parameters. Let's go take a look. Let's write a function that tries to add 10 to the argument that's provided to the function. As I said try to, because as we'll discover, that pass by value mechanism doesn't actually let us do it. Our function prototype will be, we won't return anything. But we're trying to add 10 to the provided number. There's our function prototype. To make sure I get this correct down below, I'll just copy it down here and I will say number plus equal 10, which would theoretically add 10 to number. I'll add a comment. Even though the comment will be a lie, adds 10 to the provided number. I'll just say number. The expectation from somebody calling this function would be calling this function with an argument. Let's go ahead and do that. I'll initialize this number to 5. I'll call the add 10 function with my number. The argument here when I call the function does not have to be the same name as the parameter here in the function. I happen to be using the same name here, but they don't have to match at all. Let's output the value of number after we call the add 10 function. As you can see, the value of number is still five. Does that mean the math isn't working here? Let's actually add some more outputs here. I'll say "In AddTen, Number" and we'll print out the value that was passed in. I'll get us back over so we can see that whole line. In AddTen, I'll say "After adding" Let's run it again and see what's going on. We've called the function and the value 5 has been passed in. Our number parameter has the value 5. After we've added number has 15. But our number variable in the main function still has the value 5. The reason this is happening is because C++ uses the pass by value mechanism by default. What does that mean? It means when we call the function here, it doesn't actually pass number in. It passes in a copy of the current value of number. It's not passing in the value of number, it's passing in a copy of the value of number. It's not passing in this 5, it's passing in a copy of that 5. We don't have any reference to this variable inside the function. We don't even have a reference to this value 5. We've copied 5 into a new 5 that we then pass in, that this parameter gets assigned as a value or is bound to that value, but it's assign this value. The parameter number has a value 5, but it's not the 5 that was the value of the number variable in the main function, nor is it the actual variable number. It's just a copy. We can do whatever we want to this copy. But when we return here, the variable still has its original value. Think of it this way. Say we add a sheet of paper, and that is what's stored in the number variable. I know there's no data type in C++ for sheet of paper, but pretend that the number variable has this sheet of paper as its value. We copy it to pass it into the function. That's how the pass-by-value mechanism works. Within the function, we'll care what do we do that copyright, we can color it, we can crumple it, we can chop it up with scissors, we can burn it, we can do whatever we want, because back here in the main function, even after we return from that function, we still have the original. It doesn't matter what we did to the copy. The value of the original is the same. That's the core idea behind the pass by value mechanism. To recap, in this lecture, you learned about the pass by value mechanism that C++ uses by default for functions with parameters. The big idea is that the actual arguments aren't passed into a function, copies are. I'll also say that when we return a value from a function that's copied as well.