Hello, and welcome to the 45th tutorial in the c++ programming series, and in this part we're gonna be looking at enumerated the enumeration definition defines names for a selected integer values, as it is possible to assign to enumerate a variable or the integer values that are not in the scope of the enumerator definition, something that we're gonna have to really show you so you can understand what we're talking about. So let's just go ahead and open up our project settings. Just another way to rotate integers. The way to give it give the integers key words as you will instead of the same integer one introducing into your free I didn't mean the number not saying integer one, just the number 123. So the way you declare a enough is the key word enough. You put the type of your enumerator I'm going to type and not the tower.
Yeah, I mean the name of your end numerator at the top of the name, they put some curly braces and then in here you put your keywords go have a one separated with commas and a two and hello free. There's a five for this tutorial. What we're gonna do yeah, missing and semicolon a little bit code and stuff like Visual Studio they'll pick up on stuff like this or dread the days where people would use just pretty darn rubbish text editor and then this compiler hopefully the best I can see YouTube videos were up where people are doing that. Anyway nowadays is just ridiculous. Okay, so we're just going to print out this STD line. Now if we run this, we get the value one is the second number in type we get the value one because computers start at zero not wired we've discussed in previously in this series, it's zero.
One and two, but we can make him start with something else. So we could assign this 90. So by default, by default, this will be 90 wanted to be on shift. So this goes up one before we get 91. But nothing stopping us from actually just explicitly setting another value to this. So we could say 456.
We get 456. And obviously, if we were to print out Hello, 345 10, exactly, here you go, this is an emergency. The benefit of this is just you can give a little key word to a integer number seven, literally this point integer numbers out there. Obviously, you can use variables, but you can't change the value of these just by saying that type colon comma Hello free equals something else. I'll show you what happens if you do two and two equals three. Fairly tired.
Expression is not fun, which is great. So it's all constant. That's it for this tutorial. The next part of this series we'll be looking at introduction to classes. Classes are probably the most crucial part of object oriented, object oriented programming, which c++ is an input language. If you have any questions, feel free to message us at support at sonar systems.
Co. uk email will be in the description you can comment on this video we'll start our key messages for each YouTube. All the required links will also be in the description. And as usual, thanks for watching and I hope you have a nice day. And I think I just said that all the required links I met all the requirements of the source code will also be in the description but and thank you for watching