Hello, welcome to the 43rd tutorial in the c++ programming series. And in this problem we are looking at type aliasing type. aliasing allows you to assign names or essentially keywords to different types in c++. So for example, you could assign the name f to the keyword flow. So instead of using the keyword float, to create flower, we could just use a new type alias, aka F. But you can still use float as well. It doesn't eliminate that current show you type aliasing.
It's actually something that I personally don't really use, but it's a feature of c++ and it's please worth teaching and it's up to you whether you want to use it so we just do type def, we just type in the word type def, and you type in the existing keyword for float. f because that's what we wanted. That's the alias we want to assign to it. So instead Creating a variable with keyword flow we can just use f name a variable variable that's very creative that we can see knowing. Now we just do STD C and variable STD. And now if we run this we get 9.8.
But if we just change this to the key still works obviously still with the original keyword it doesn't eliminate that by any means. Alternatively you can also use this they both do the same thing you can do using f equals it does exactly the same thing as type def. But again, it's up to you whichever one you want to you don't have to comment this one I personally prefer this one if I were to, you know, just pick a little just because of how it looks. But again, that's totally up to you. That's it for this part. In the next part of this series we'll be looking at Union if you have any questions, feel free to message us at support at solar systems Dakota, UK, the email will be in the description you can comment on the videos directly messages via YouTube, or the recording for source code will be in the description.
And as usual, thanks for watching and I hope you have a nice day.