Hello, welcome to the tutorial on the c++ programming series. And this problem in looking at strings. strings, as the name suggests, is just basically a piece of text that allows you to do stuff when you create a variable, which is what we're going to be doing. And unlike the other variables that we've created, so in flow, double, Boolean, etc, it has its own hash include basically its own header, its own file. And this is actually a class it's not you create an object string object on like a variable, but it also has its own function strings are a lot more powerful than int, char Boolean or what have you. So let's just go ahead and open up that project.
Okay, so let's get rid of this line for a second. And I first thought sorry we need to include the strength header so it's literally just called string in angle brackets these angle brackets are for when you're including a library file and you use quotation marks okay these when you include in like a custom file, but we'll get on to that later on in this series. Um so to create is part of the standard namespace they need to do STD colon colon or or pH but using namespace std and then you do string name of the string on the input s then bracket bracket and inside here you just put what you want to have inside this variable from for Hello this is a grain STD s STD nine semicolon that run it. And we have the string printer. Yes, but what we can also do if we do ask doc to access this objects method is a bunch of methods, open Fs, MTA raise stuff, but we're gonna look at length.
So if we do have, we run it and it says 22 characters. It's also includes basic sort of, it's counting 1-234-567-8910 1112 1314 1516 1718 1920 212 and two. So yeah, as I said, it does include spacey sort of bear in mind when you use this. But there's so many more functions there's a ridiculous amount. And yeah, there's a sorry service. Just run that the same again.
Don't remove the main file, systems, anything else? Interesting that we can as quickly show you in this tutorial we're gonna see string will basically sort of printed out at a char string. So this is useful for stuff that will take maybe in her char array. But yeah, that's it for strings in the next tutorial we're going to look at constants which are similar to variable but that are constant. If you have any questions, feel free to message us at support at sonar system.com. Okay, the email will be in the description.
You can comment on this video which is directly messages via YouTube. Whatever you feel comfortable with. All the requirements for source code will also be in the description. And as usual, thank you for watching and I hope you have a nice day.