Hello, welcome to the 17th tutorial on the c++ programming series. In this part, we're gonna be looking at the typecast operator. This operator let's convert a value of a certain type to a number type for maybe an integer to a float or float to an integer. Obviously, if you do something like a floating engineer rounding will occur. Let's show you how to implement this within c++. And then just briefly remove this create a variable called boy, assign it 5.67 and in a float variable, as you can see, and we're just going to see this out and line one gonna solve the actor console through a guy with a 4.67.
And we can typecast this to another type of data. Simply by printing the keyword that we want to typecast it to aka the data type. So we're going to put in and we can enclose the actual variable in brackets over one that you're typecast and it puts it up five, so it hasn't rounded. It's weird how this is truncated, I should say, but the alternative whether you convert it, and that is by putting the data type in brackets, either way, worth I generally prefer this method by putting it in brackets like this or the variable or the data ocean, same bracket. This is how you use the typecast operator. If you have any questions feel free to message us or support our solar system kvk the email will be in the description you can comment on this video or just directly message us via YouTube while they require lymphocyte source code will also be available in the description for links.
And in the next tutorial we'll look at bitwise operators. Thanks for watching and hope you have a nice day.