Okay, so in this next segment we're gonna see how to do C++. So here's your first C++ code. And this should be just transparent. As I say, you should jump off right after and do problem one. So. Ignore the dots but in my C++ version I'm going to half rest of line comments. In the C community, we generally had initially multiline comments. The thing about rest of line comments is they're more flexible. And they're generally a little safer. Now I have to give you a little warning here. What's the warning? Some of you are gonna say, wait a minute. I used this kind of comment with C already. And yes indeed, in the C standards that exist now, that comment style is now available. But, when the languages started up, this was novel to C++ so it's C++ style. So there is a little bit of slurring over what the differences in the two languages are. Many of you are gonna be using the GNU compiler. The GNU compiler combines both C and C++, and it's not always clear where one starts and the other stops. So, one I am gonna be talking about is more classically what was C versus what is C++. Now, again, we have standard libraries. And in the C++ community we tend to drop the .h, .h was a notation reminiscent of meaning that you had a header file. In C++ we just give the name so iostream is the IO package, and then if I see a little c in front, these mean import what would also be a library in C. So C++, again, superset, C++ can use all the C stuff. And if you need a C library, a classic C library, it's available in the standard libraries through C++, and it's generally written as c with the same name taken from the c library. Now, we have something called namespaces. New idea. A namespace is again a context, an encapsulation. Let's say I'm IBM and I'm writing software, and I have special stuff that's IBM stuff. I may wrap it up in a namespace and call it IBM, my namespace. This namespace it std. Std stands for the standard library. But IBM could be using namespace IBM. Where IBM wants to have its own libraries. And you can mix and match, so you can have different namespaces involved in the same program development. You could have the Oracle libraries, the IBM libraries, and the standard library. Or you can have your personal programming libraries. So namespace is another context. It's again a naming convention that's on top of the existing naming conventions of the C language. Okay, and then this using directive, this using statement, just lets the program know that the expectation is I'm going to be using the namespace std. And I'll explain in a second why that's a convenience. Now here we replaced in the other program, a sharp include, what was a macro. So, in that other thing, we had sides being six, but that was a macro. And this is a definition. And this definition uses a keyword const. So we are saying that this is a constant of type int. And now this designation, this identifier name has typing, and it again has context so that the compiler can check everything with language rules as opposed to a macro preprocessor. Substituting six wherever it's lost size. And that substitution is a textual substitution that is independent of the language rules. And again, you have to take my word for it, programming methodologists, when they studied the use of textual substitution, as opposed to language contexts. Find that more errors are made when you allow pre-processor textual substitution. So this replaces a pre-process of textual substitution with a language rule, a language declaration for the same purpose. Similarly, where we had macros for little inline coding segments, we now have a keyword inline. So inline is a new keyword. It's a compiler directive. And what it's telling the compiler is hey, I have some function called r_sides, and here is its code. But I don't want function call. Why don't I want function call? Because function call costs me money. It has run time characteristics where the code has to go to the stack, has to initialize the stack and has to call some complicated machine level instruction which is maybe some milliseconds. So I can replace that by pure inline code. That's exactly what the macro was intended for, but here again we're now using or language. So we get language characteristics enforced. All the rules of function apply as opposed to textural substitution by a macro.