Now Welcome to the 34th tutorial on c++ programming series. And this poem is looking at overloaded functions. All these functions allow multiple implementations of a single function. Okay, multiple functions that share the same name, but are distinguished by the number of arguments they take or the type of arguments they take. And they the way that the compiler can say, Okay, you've called this particular function over this particular function. So let's show you how this works.
It's very common practice to have multiple functions with the same name, usually that form very similar functionality to that the parameters are slightly different. So what we're going to do, we'll create a function called named function, very original as you can tell when they make you take to float variables. There's an inherence on the return a copy, I'm going to function we're going to do is the same, but we're going to have in a, in a return a bit of a semi follow along. And if I were to just run this now, he succeeds know what's in the concept is printing all them by default, but it does work. But if I were to change these to an integer, the this one and this one and now we're gonna be failure because it functions that only differ in their return cannot be without them because the only difference in these two functions is the return type compiler if you would call it wouldn't know based on the parameters the parameters are the same.
So you have to even have different types and or different number of parameters as well. So let's just demonstrate this morning. So do s t in C out and then here within this function for a million city now, what we'll also do a look at STC and lowercase in uppercase, and we'll just simply go through the function. So you can exactly see that this one has been called audio one will do a copy and paste test here. change this to integer. Everyone this is kind of a low pass into the function 27 creates a chain these two float variables, so forth.
Like seven eight by fit and so with the flow variable, as you can see is a good thing to show you. This quarter function is ambiguous because we've got a flow variable we're integer variable, but if we were to make both of them flow 2.9 It's a okay with that. So if we were to conduct a float function is 37.4 to two, but we've covered custom so if we were to cast this to an end on to when it when we get into the function, and what what has happened is, these two numbers have been truncated. So this should become the three and this one becomes a nine, hence the result 27. That's it. That is it for this tutorial that they use overloaded functions.
If you have any questions feel free to message us at support at solar systems. co UK, the email will be in the description. You can comment on this video or the sterically method or through our YouTube Wherever you feel comfortable with, or the recording for source code will also be in the description. In the next part of this series, we'll be looking at function templates. And as usual, thanks for watching and I hope you have a nice day.