The basic idea that makes C++ a modern language as opposed to C as an old style 1970s system implementation language, is that C added classes, and classes is a way to encapsulate an abstract datatype. So we've been talking about abstract data types in C. Generally speaking, what we use is a struct to create in effect a new type of data. But the struct by itself doesn't have operations and the struct by itself is openly public, so it can be tampered with. One of the things that's important in modern programming is encapsulation, and encapsulation allows you to hide stuff. So think about working on a car, there is stuff in the engine that only an unauthorized dealer can get at, and otherwise, it's not to be tampered with, and you might call it a black box. You still can use the car if you know how to operate it. So the same thing is true with a class. So C++ takes the concept of struck and adds to it ideas that let you do further encapsulation. Now, let's think of wanting a new type, let's call it a shape. So a shape as a noun and in classical C, we would represent it with some struct, and then we would write various functions that could perform actions on it. Normally, the functions would call on the struct through a pointer to struct. So we could think of a shape, and we could think of computing its area, and we could think of drawing it on the screen, and we could think of finding its position somewhere in the plane. Those are various actions we conceive of of this type shape. You can imagine that you're at a company that wants to develop, let's say, architectural plans, and they want an elaborate way to automatically draw such plans and help the human architects. So they could sit down and write such a package, such packages exist. So if we had shape, we would have different kinds of shapes, and they would have different ways to describe them, and then again, as I said earlier, we would have actions on them. Let's just take a little bit of a look at how that might get done in C++. Let's say we had the shape rectangle, so we use class instead of struct, though struct is usable here. It's a subtle difference, but in modern C++, you should use class, keyword class. Then you get to name the new type, we'll call it rectangle. Then you have an open brace, just like with structs. But then you have a keyword which is a privacy keyword, and that privacy here is public, which means everybody can use it. Then you'll have what's called a constructor, that's a special kind of function that allows you to build one of these objects. It's the idea behind an int. Int is a native type, and so the compiler knows how to build an int, it's typically a four byte representation inside memory. Here rectangle is allowing you to use previously defined types and then build this new type. Here's an action on the type called area. Area returns height times width. I don't know why I have it as weight. So with that correction, we have also private. Typically, in modern languages, and this includes languages like Java and Python, you hide away the representation, in this case, a height and a width. We could consider other operations if we were to flesh this out, such as a drawing operation. Now, in our main program, we might declare rectangle as r, and we give it things to initialize 2.5 and 2.0. We might have an ar variable, where are we going to compute area, and then we can say ar equals, and we use the dot notation, which is as same notation that you use in C with structs. Now, what happens is on this rectangle, don't forget r is a rectangle, area is computed, and secretly, area is this thing with a height and a width of 2.5 times two. So this ar should end up with a double value five. That's the essential idea that Bjarne Stroustrup added to the C language to change it into a modern language in which you can easily extend the datatypes by using this idea of class, and the idea of having member methods. So not only like in an ordinary C struct, you had member data fields. Now you also have member functions, or sometimes in modern OO speak, they're called methods, and we'll see that in a second in code.