Hello, welcome to the 26th tutorial in the c++ programming series. And in this problem we're looking at range basically arraign basically has a slightly different syntax which is used to loop through basically ranges of data instead of looping based around a condition. Let's show you how to use the rain base loop. And in many ways, you can just do the regular loop and make do the same thing in the rain. Basically, you have to do a lot of extra stuff yourself and if all you're going to be doing for this particular in that particular instance, denim rain basically is best when the first is in clewd truing other women just looping through a string in the string str to us, the std namespace as to We are just going to simply sown the value, hello, world. And what we're going to do is for the syntax is for log for loop inside instead of doing the first statement, which is set up in a variable.
The second statement is the condition the first statement, which is usually like incrementing or decrement in the variable manipulating them somehow. What you just do is do like char C, we because string is made up of characters, like hate to the creditor, or the counter space in the theater, yes, it was basically theater, and you do cola FTR. So basically what this means is, you'll look for this and every time the big three c will be the next character in this truing code STL which is well this one here. The dudes do STD see we are going to see STD and then if we just run it we have hello world HelloWorld printed out but because obviously print new line character they're all new 9.7 in a space is put each crate on a new line but a lot of us to loop through it and get every single character instead of trying to set up an incrementer Gehring, the length of the string, then getting a particular position in the string based on our iterator.
This is just a lot easier but obviously as you can say, it's a lot more limited compared to a for loop and you generally wouldn't substitute this for a lot of foliage this just well arranged grateful. That is it for this tutorial. If you have any questions, feel free to message c++ support systems. The Cody Kay email window description comment on this video to start getting messages via YouTube as well. In the next part, we'll be looking at the go to statement. All the recording for source code will also be in the description.
And as usual, thank you for watching and I hope you have a nice day.