Welcome. Today's lesson is about complex aggregates. We're going to focus on a list type. Of course, that's a very standard data structure. It's what we sometimes call a self referential data structure. And that a list is, the head of a list followed by a list. So, you use list in its own definition, and it's a more interesting aggregate because in some sense it's an unbounded aggregate. You keep adding elements, so you need to be able to access memory. This kind of memory is heap memory as opposed to stack memory for ordinary variables. So, studying this has several benefits. First off, the list data structure that we'll see today, which is a single pointer list, is in the standard template library. So, it's not like we need to create it ourselves. But in order to understand what goes on in building these more complicated library based aggregates and how they can be used and what's efficient about them; it'll be useful to do a simpler version ourselves. This will let us, if we need to, create variations for ourselves, because not everything is in the standard template library. The second thing we're going to see is more complicated constructors, constructors, again, that use the heap to allocate and then, because it's very important to properly manage these resources, not have memory leaks. You will also learn how to properly deallocate and return resources, namely using destructors. So this is a very, very central and important lesson. And will pervade more of the advanced topics that we're going to do with the rest of the course. So on this slide we can see actually show it both ways in let's say the use of struct. In more of an old style where again, struct is the aggregate type developed in C. And then, of course, Bjarne Stroustrup, when he reinvented the language or extended the C language. initially called it C with classes and then the more clever name C ++. So struct morphed into class again. This is review. struct just means everything is, by default, public. So here we don't have a, keyword, public, it's just implicit up here. But of course, nowadays this is what we prefer, we tend not to use struct unless it's a very a simple, plain old data (POD) type, as in C, then we might use struct. So here we have a public, we have a base simple constructor. We see it has two defaults. It has an integer n which is going to be, if we think about this. What we're going to ultimately have is a struct element, is something in which we're going to store data. In this case, it's just going to be an int. Could be three. By default, we're going to store zero there. And we're going to also have a pointer, which conceptually is something like this, a memory address. And by default, it's going to be a value 0 or in modern C++, if you have a C++11, you could as well call this the null pointer "nullptr". We'll see that. As well. We're going to try and transition you in this class to the use of the most modern C++ constructs as well. So we have data and we have a next pointer and those are the two fields that get initialized. And this constructor with its defaults of course, allows us to have a number of signatures. In fact, since it defaults, it would also be the empty signature. So it could be used as the default constructor. We'll take a second, and in the previous list, constructor, the list element constructor, what is zero used for? Okay, take a second to think about that. As we pointed out already, the answer is an important answer, the pointer is a zero value, which is the null pointer value. And here as I stated. The newer practice is to use the keyword " nullptr " and the reason for that it's an improvement over an ordinary zero. Zero's really an integer value. it can be cast but it's really a zero , historically an integer. So to use it as a base type for other things, is basically to, to work with conversions. also just to keep in mind, there is a macro called NULL, so that's also conventionally seen. And this is an improvement over both older practices.