Now, let's actually do some C++ code to show you how easy it is. First off, C++ introduced these rest of the line comments, and they are now very common in NCC as well. So when you don't have slash star star slash, sometimes that leads to an error if you leave off your star slash, and these rest of the line comments are easier to put in in all places. Now, we'll see different forms of include. We'll see include io stream, and we don't have the.h, there are.h's available, but C++ understands these to come from the standard library. An io stream is where you find the io that's adopted in C++. Now, you can return to C standard io. So if you wanted, you could have said it includes c standard io, and then you could use things like print f and scan f. But that's not considered good form in the C++ community. C++ has another form of naming which you add onto your identifier names, it's called a namespace. So it's another way you can encapsulate things. So if you have a big chunk of library that you want to use, and that library is prefaced by std, then using namespace std lets you omit the std. As you'll see, we're going to use things like c out and c in, and they really come from the standard library, the encapsulation of the standard library. So if we didn't include using namespace std, we would have to over here write std::. Now, we could do that as well, that didn't create a problem, but at this point, that's redundant. Let me get rid of it, this is unnecessary here because I put that namespace:std. What does that do for you? Well, let's say there are other libraries, like one's coming from IBM. You could have using namespace::IBM. So libraries could collaborate and their identifier names wouldn't conflict. Another thing we see in C++ is we have const. Now again, const is adopted in some of the newer forms of C, and const means that this identifier cannot have its value changed in this program. Again, it's a way to allow type-checking. So this is const double, so the compiler uses type-checking statically to watch out for errors. Another thing which is an interesting improvement is to use the key word in. This is a keyword in C++ inline, which tells the compiler to attempt to optimize a function. Generally speaking, I won't get into it in detail for you, this is just a beginning course. But when you have function call, you have a bunch of setup that may not be needed, and instead of doing this all over, if you just take this little code segment and put it appropriately wherever it's being called like convert over here, that's where it's being called, and turn that into miles times mtk, you would save on what's called the function call. Now, some people no longer want to use this because they say a compiler would have an optimization flag and you could let the compiler more appropriately optimized. But originally, C++'s intention was to avoid using sharp defines, because sharp defines are pre-processor ideas and they are errorful. Inline was intentioned to take what used to be called macros and replace them with these optimized functions, which then would be syntactically checkable and do appropriate things, probably there are things where there's conversions when you call these functions, that wouldn't necessarily happen if it was a pure macro. Anyway, inline, as I said, it's not something you need to use, but it was at the time a small improvement. Then we have int main void as before and miles equal one. Let me just say that in C++, this definition or declaration doesn't have to occur just at the head of a block. So another thing that you found with C++ was you could put things inside code declarations, inside code, where they were nearest to where they were used. Now, miles gets used immediately, so it's necessary to put it at the head of the block. The while statement it has before, and here's your c out and your c in, notice how much simpler, and then we just say c out, distance is, we call convert, which gets us a double, we then print kilometers, and then we have this endl which effectively gets us a new line. It's another way to get a new line. We can get a new line with backslash and/or with endl, endl forces the buffer to be flushed to the screen, and there's another endl. So notice how these things basically concatenate, again, fairly easy to use io. I think I compiled this already, that's the wrong one. Let me go back and compile it. So I'm going to use g plus plus, miles to kilometers, cpp, I don't know if you noticed, but I was using a, and now I will execute that. So as input distance in miles or zero to terminate. So if I do like three miles, I get 4.827 kilometers. Six miles, I get 9.654 kilometers, 26 miles, which would be roughly a marathon, is roughly 42 kilometers. Let me terminate, zero, of course, the distance is zero in kilometers as well. So that's the first program. It shows some of the power. It should immediately be something you could do with any of your C programs. One of the things I recommend is take a simple C program that you've done for this class, and just try and use some of these ideas and convert it.