 Alright, so let us continue our discussion on structures. So you know in this lecture, I mean the first few slides are basically trying to say that when we talk about a structure, when during a discussion I mention about a structure, what exactly do I mean? So depending on the context, I could refer to different things. So for example, you know if I say the definition of structure, my struct type is given here, I am referring to a specific structure or if I say that you know my variable is a variable of type, my struct type, sometimes we say that this is a structure itself because it is a variable of struct, my struct type. So sometimes it is used to refer to an object of a particular structure, sometimes when we say a structure of type, my struct type needs 5 bytes of storage, I am referring to a generic object of that structure. So you know all of this should be fairly obvious, but you know we have just highlighted so that there is no confusion or I could say that you know a specific object which I am referring to a structure, my variable. So depending on the context, when I use the word structure, I could mean a generic structure or I could mean an object of that structure and it should be obvious from what we are trying to discuss. So here is a simple example about points and disks in two dimensional space. This is motivated by Professor Ranade's book and so point of course has in two dimensional space an x and a y coordinate. So we have two members x and y and both of them are of type double and this can be visualized like this. So this can be visualized like two chunks of storage allocated, one for storing x and then a disk has a center which itself is a point and it has a radius which is of type double. So an object of the disk structure will have two members center and radius, but center itself is of type point. So center itself will have two members x and y. So this is obvious, this is kind of hierarchical structures. And then if I say that there is a object p1 of type point or an object d1 of type disk and I could initialize the members of p1 in the usual way. And then I could copy p1 to d1 dot center, d1 dot center is a member of type point. So when I copy p1 to d1 dot center, all the members of p1 get copied to the corresponding members of d1 dot center. This is copying a structure from one structure to another and then I could set the radius to something. Alternatively what I could do is I could say something like this that d1 dot center dot x is 0.5 and once again this should be clear what I am referring to, d1 is the object of type disk. So d1 dot center is the member named center of d1 and d1 dot center dot x is the member named x of the member named center of d1. So it is just going down the hierarchy. And I could also initialize members of hierarchical structures in this way. So we have seen that if I wanted to initialize let us say a variable of type point, I could just specify the values of x and y within braces and that would initialize it. But how do I initialize a variable of type disk where one of the members is itself is a structure point which has two members in it. So we basically use the same way that I would initialize a variable of type point. So here for example, I am initializing d1 which is of type disk by specifying two values one for the member named center the other for the member named radius. And how do I specify an initial value for the member named center just like I would specify an initial value for an object of type point by specifying values of its members within braces. So that is exactly what we have done here. So what is important is that the order in which you specify these initialization values is the same as the order in which you have declared the data members. And this is a similar thing except that it is const which means once you initialize it you cannot change it. Now what would happen in this case? Suppose I am trying to define a structure called struct type 1 which has an integer member x and then I want to have a member named y of the same type struct type 1. So this is kind of like a recursive definition of a structure. So this actually would have some problem because you know if I try to determine how much storage I would need for an object of type struct type 1. So how much storage would I need? I would need to store an integer for the member x that is 4 bytes plus the storage required for member y. Member y is of type struct type 1 so that itself would require an integer and another member y which itself would require an integer and another member y and that would go on forever. So this would basically lead to an infinite amount of storage being required for just one object of type struct type 1. So C++ disallows this thing because this is not feasible I mean you cannot have infinite storage for an object on your computer. The other thing to sort of remember is that where should we define the structure types basically in which parts of the program should the definition be visible. So if you are using a particular structure only within the body of a function then you can define it within the body of the function like I have shown here. So this function is the only one that uses point and disk so I can define struct point and struct disk within the function. But here there are three different functions which are using point and disk. So I have to define these outside these functions and before them so that when the compiler goes through your program it first sees the definitions of the structures, then it sees the functions which uses them and then it knows what are the structures you are talking about.