Hello, welcome to the very first tutorial, the c++ programming series. And in this problem is looking at function arguments that are passed by value. Basically, function arguments are variable, they are very both in the function where you can pass in from main variables, all values to a function within the actual brain brackets themselves at the end, we left them empty for now, which basically says when you call a function, you actually pass in a parameter there. And if you have two arguments, you have to pass in two arguments. There are all sorts of ways to get around this. But generally, that is the case demand items, you have data mining values, you have to pass in.
Also, actually, we'll just go ahead and open up our project that actually just wrote a function so you can see where the arguments that we can talk about a little more. So what we're gonna do is go to this second And this right here are two arguments within the main function of that entire argument, the constant char augment our, again, if there, because there'll be a certain type, you have to pass in data of that type, or he will just be cast that type of like maybe an interview, passing the interview to a flow yoga class to a float, and so forth. So what we're going to do is create a function called void. We call it math function. And in here was going to put in then the variable name, I'm gonna put number one in number two, and these variable that have been declared in here are local, as in the the scope of your just below this function.
So if I were to just try and do number one equals 10 Give me an error. And if we go to it says useful undeclared identifier, and it's only declared because it's only accessible within this function. So this looks at a local variable and also obviously the datatype needs to be specified. And because it's a local variable when we pass some de train or if you pass a variable in and we affected the variable in here, you wouldn't change the original value create a local copy, but let's demonstrate that or I mean is if I were to do number one, for example 98 and then in here became equals 78. To math function so to call it you open close bracket and we need here you specify the two parameters around do I proud 27 now it's going to STD C. Ce O, 's TD, annoying thing to put and it just needs to open up the depot area we've got a value of 70.
And even though you've changed here, it's a local copy. So this number one is technically not related in any way shape or form originally has the same value as on less than a second is a mathematical function here. This was a sub demonstrate the scope of what we're going to do is put a few number the number five and six. We're simply going to do STD C, and number one, and then number two, that will be 30 TV long running, can we get the result of 30. In a previous tutorial we looked at return types for functions and like here we got an int main. So this returns an integer value or a variable that is in today's age, okay?
And you can do the same with the main functions that have arguments in it. That's it for this tutorial. If you have any questions feel free to message us at support at solar systems calm Okay, the email will be in description you can comment on this video has directly messaged us via YouTube. In the next part when we're looking at function arguments that are passed by reference, or the recordings of source code will also be in the description. And as usual, thanks for watching and I hope you have a nice day.