Pointers in C++ | Abhishek Kumar | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
9 Lessons (52m)
    • 1. Overview

      0:36
    • 2. Introduction to C++ Pointers

      6:44
    • 3. Pointer Memory

      5:31
    • 4. Pointer to pointer

      3:02
    • 5. Dereferencing Pointers

      4:55
    • 6. Pointers and Arrays

      5:42
    • 7. Character Pointers

      10:40
    • 8. Dynamic Memory - Stack vs Heap

      14:20
    • 9. Conclusion - What's next

      0:36
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

45

Students

--

Projects

About This Class

Pointers in C and C++ are one of the most fundamental and useful concepts. But, students generally find it difficult to grasp the concepts if they are beginning with C++ programming. In this class I try to present the concept of pointers in a simple and easy to understand manner with programming examples.

After completing this course students are expected to understand and use pointers in C and C++ efficiently in their programs.

Meet Your Teacher

Teacher Profile Image

Abhishek Kumar

Computer Scientist at Adobe

Teacher

Computer Scientist @Adobe

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

phone

Transcripts

1. Overview: Hello. My name is very sick and in discourse. I will be teaching you about one of the most fundamental concept in C and C plus plus, which is called Pointers. So this course is divided into eight lessons and truthfully consists of 45 minutes of video tutorials and ah, I expect some basic knowledge off sleeplessness programming for understanding this course writer. So in discourse, we will study award. What are pointers while you're this so important and the house will be efficiently used pointers, So welcome to the schools. 2. Introduction to C++ Pointers: in this video, I'm going to introduce you to see business pointers. So let's see Waters Pointers point. It is just a variable that stores the address off another variable. So whenever we declare any very well in C plus plus, then this very will be relocated. Some memory address and those starting off this address will be the address off this variable, and we can store it in some point off type s, so we will see it later. So first, let's understand what his memory and how is it allocated to a variable. So computers, memories, a sequence of bites in increasing order and eat my bait has an associate in address on gonna will be declared a very well. It is located one or more bites, depending on the variables data type. And the starting byte addresses the variable surgeries. So let's see this picture really support. This is the computer's memory by memory, we mean the ram off the computer, and it's divided into multiple mates. And let's say it starts from 10123 and so on. And here it's 505 101 for you wonder too. 503 and so on. And when we declare you very well in a so intentionally given poor waits in memory for here , let's it's located this part of the memory. These four words. So when be store equal to six, then this. Six. Retake these four words in the memory and this starting in just noticed flavor under Bilby . Address off Miss Very one A. And we have an operative court imprisoned, which we also call address ALOF operators using this weekend find out what is their dress off this variable to is the right and percent a. Then this will store the value 500 regenerated in ex servicemen, but for but our understanding I am writing it in the small former. So let's see how to use pointers. So first the sin taxes that we first right down the variable type. So in our earlier case, it was int. Then we have this Estrich Same to denote that this is not a normal very well, this is a pointer pointedly also available but into stores the specific really that is an address. Then we write as tricks ain't so installments This very believes appointed during teacher and then the name for example, a prettier and then we use their dress off operators to get their address off any variable and then we can assign it, for example, via you can't numb one equal to 10. So this number one will be stored somewhere in the memory. That's a 500. So it believe 501 213 So the stand will be stored from here to here. Then we declare in number tear. So we say that it's a pointer to interior, so it will store and address off it point Terreri and address often in teacher variable. And then we assign it this address off number one. So no, If we tried to print this number here, the suit print 500 in exercisable. So let's see this returning example in X Corp. So first, we will create one into your available and assign you to value tin. Then we create one in future Pointer and the Assane their dress off. He you could also return it here only, like equal to percent in for that role to work and ah, this pointer. We can put it here also, This has strict mark or here before the variable limb or after the the variable type. So both are Belliard. No, let's see, what's the address of this? So we will bring tort. This is a pretty available which stores their dress Sophie, so it should give some extra additional value. So this is the address of very well and everything. We don't be very good, different values or we make it simple sometimes no if the we can or tisane a different addressed to this pointer. So this is an in teacher pointer So we are supposed to give it their dress often integer variable. So if we have a double, be equal to 10 point you and if we trade to assign it every tear this is appointed to interior her dress off be, then it will give an error. So assigning into star from in comfortable o r type noble start. So we're not supposed to a sane if double addressed when in teacher Quinter Still decision . So that's all for this introduction video. You will see more award pointers in the further reduce 3. Pointer Memory: different data types are very different to space in the memory. For example, Character and Boone take one bites sort of folkways. Two bites in long and cook 64 waits. There is double takes it mates. So this information is very useful when creating an area. So support Israel and in t zero very. And it has elements and we have a pointer to the first element. So each of these elements are cooperative. Four bites in memory. So if the starting addresses, let's say 100 then the next gentleman will restore that address. One beautiful on the car will be started when you do it and so on. So it's dissident into your pointer, pointing to the first element. And if we do plus plus on your then the pointer, shouldn't nobody home much? It's a dead ones. So in case off int, it will advance way forward because it knows that the first element will be taking four raids in memories and next element would be poor, White said. So it moves to one euro for and when we again do be tear placeless, then it will move again by four bites, and it will go to when you do it. On the other hand, if we heard you sort Eddie and Eddie all sorts, then we know that a sore Taco Boys two words in memory. So if we have acquainted here and we do pointer placeless, then it would move by two weights. So this are taping for missing is very useful when I treating the area. So if we want to print the SAGES besides off different database, we can use the side off operator so he'd be do say, Just care. It should bring one great similarly for bull. And if we do sage off sort, it was urgent to rights and for influence long it will bring four bites and for double Ritter, print it rates. We're ready. Reprint this character pointer. It will print it right on a 64 bit system on If we do interest are again, it will print the same value. The registry prince, a different it will print for and so I just carried will print one. But in the case of care star or into star or double starfruit star, it will always bring the same value depending on the system because these all are storing some address off the memory, which depends on the system. Hold many boots system is it? So this is independent of the liturgy. It saves. Very the safety off. The detritus are different. Let's see an example in X court. So I corporate these two values. And if I run it, we get this age off carries one weight and this age of carry stories. Care 10.30 rates, notes, comment or miss part of the court. No, I will do this same thing for all the other tapes. - And Noah, let's bring the corresponding point of values. - So we see that character and will occupy one bite sort is too great in float our poor waits Long is eight weight, double digit rates. Where is all the pointers Our seem the side off all the point is the same. That is a great and this difference on the system. So there's one correction here in the longer I was writing four rate in this late. So on this system, it's thinking it rates. So that's all for this video. See you in the next redo. Thank you 4. Pointer to pointer: instead of storing address off irregular variable according To can also store their dress off another variable. So we called such pointers. When should we appoint toe? Let's see this with one example. So here we have one integer variable no and it stores of value often. So let's see. This is the memory block that is storing turn and it has some address. Let's say 100 Then we have number tear which stores this address so we have another variable. This is numb, we tear and this is numb and this is stores the Sadrist Notice 100 and this is itself. Let's it 300 at memory address and there is another pointer which is pointed toe this in star for enter. So we have no me to your we tear. Let's see it, Sir Driss for your 112 in the memory and this is stores. It's endless noticed 300 address, often into your pointer. So on this we will call a pointer to point because this is pointing to it very well, which is itself. A pointer on this point is pointing to an end. So when we have to access the value stored in this and we're given this point of view a pointer for struggle. Difference it to get this first level pointer and then we will leave reference it to get this value. So let's ah, see it in the X Corp. So now here I have returned the same example Bullets run it. So your first we're printing their address of this Mom. Andi, we're printing the value off number tears, so Number T Air is actually holding the address of Numb, so these two should be same. Then we're printing their dress off this point to itself, and then we're printing the value off this numb pickier prettier. And this is willing the address of this. So again, these two should be same. And these two certainly same. So let's run it. So we see that this tour seem the address off numb and value of non prettier because lumpy Terry just holding that dress off. Similarly, number dear Vidiri or Linger, address US number tear. So the year scene. So that's all for this bill. You see you in the next missing. Thank you 5. Dereferencing Pointers: So far, we have been looking at what point? Just a store. That is what addressed. The point is pointing toe. So this is not very useful until we know how to get the value of the variables that the point is pointing toe. So the process off getting the stored value to the very well that the point responding to this cold be referencing the pointer. So this is achieved using the difference operator, Which is this a strict off Richard. So if we have one there, even in a culture often and we have another pointer doing to you, we distorts their dress off A for a year, which is Stonington, and it is that address 100 and there is a PTR, which is just during this address that is 100. So it's pointing toe Miss Variable and this is that our Dressler said 300. So how if we're given this pointer a prettier how can we get this is stored value so we can do this using full etc. I have another int. If we use this data trends operator before the name off this a prettier, then this will go ahead and this address 100 Andi reference it and get what is the very least ordered Norton dress. So first it will see that it's an end pointer. So it will start reading the value starting from address 100 101 100 to 103. So it will see what is the value stored in these four words. And it will return their value on no civil. Contend this the lutin. So we can even do this for multiple level point, just like in the last week. Gov So appointed with winter. So this is pointing to this point and decision Turn pointing to this. So this will restore there just 300. So once we did reference it, No, this really will become 100 because you don't go ahead and see the values toward this. And once again, you've read a difference. It it will go to address 100 dear friend will even it will fetch 10. So let's see a cold. So this is the same court and number Deary's storing their address of numb on this interest are starting on prettier. Prettier is during the address off this in pointer. So is reprinting. Um it will drink 10 if we print number dear It Will Prince a murderess. Let's under. If we did a friend's this number here, then it will set the value. 10. The values to order this address 100. And if the dear friends this numb, prettier, prettier then it will print the same address and directs 100. And if we doubled the references, it will again go here and read a flint value, and it will fetch them. So let's see this in X scored. So here I have returned on the jump in. So let's go ahead and run it. So we see that first regarding comical to 10. And when we did influence this numb, prettier, the again get in. But but number here is just holding address. So we print number here it will print one address pickle, dizzy appointer and holding a value racism address off this numb. And when we did a friends, if we get back the mom, the value stored there and this is the pointer to dump it here. So when we d reference it, it will give this same value. And when we do overly difference it the world. If de referencing this number, tr pretty average equivalent to referencing de referencing this number here. So here also, we get 10. So I hope you got the point off. How did Referencing is done. So that's all for this video and see you in the next. Really? Oh, thank you. 6. Pointers and Arrays: pointers and every names are closely related. Every name contains the address off first element in every Leviev in Eddie off current elements. So this her dress off this first element is contained in this era name through a R R is pointing to this first element off this area so we can use it to initialize a pointers. Since this name contains the address of four still burn, we can assign it to a normal point, and we don't need to use the and operator that is the address off operative. But there is a difference on Lake normal pointers. We're not alone. Mortified, so a normal in pointer can also contain that resource. First element. Its decision in Terry and this a R r is also internally containing their dress off first element. But there is your difference. So the similarity is that both are or linger are dress off for Stillman, but their differences there here? No, we can assign a different value toe be so often something we can assign a new value to be, Let's say, want to assign it to third element, then we can do that so this pointer can be modified to point to some different address, but it's the do something like they are are equal to some other address or some other value . Let's system indeed a key. Then this will through an error. We cannot modify it. It will always going to the first element. We can use Pointer automatic to access old elements off binary. So let's take an example here. A r r is an area off in teachers off size 10 for busy err. This is indexed Studio one on the Lost in Next recently on Recreate one into your coin to be and a sign e r. But we know that this area name condensed their dress off for still Aerin. So this it means that he's pointing here. No, we I trade this look 10 times and we print the address off every element so far stained easier. So it will print the address of this. Let's say that addresses 100 So next would be addressed 104 because in teacher takes four bytes in memory, so starting here it will take four rights, then again for weights and so on. So here, this, uh, in teacher pointer will help it in doing the point of automatic This we call in your prison and your mathematical present that we're doing the pointer we call it point arrest A Matic . So here we are implementing this pointer by one so it will automatically advance rate four steps, poor bites because it knows that it is an interior. And it would occupy four rates in the memory first started from when you when you are a hero, so it will no point to So first it will print 100 then it will advance to one euro for in the next state Tourism. The night is one it will print when you're full and again heard wants by four steps. So when you do it next time it will print this. So every time it will print on address, which is poor more than the previous address. And if you want to open the element er that police in we could've need a friend difference it then in current the point. So let's see this example in the X Corp So they are ordered. Is it in the court? So I am creating one into your area of size 10 on and then this endpoint responding to the first element. And we are incriminating this Ah pointer every time and printing it. Who lets running? So know this first element addresses this 6 40 So this previous rallies are common to all of these, only the last two digits Search Meaning So let's see focus on the last two digits. So first element er just 40 been for people than 48. So it's incriminating way for then in Exodus Small four Siemens Ah see means clue. So Bill plus full so you can see Jiro for it then Siemens still and then Ah, here it increases by one. So it's 16 and then here it's zero for 16. So unit inclusion way for so every time it will increase way for because in teacher occupies forwards in the memory. So that's all for this review. See you in the next 1,000,000. Thank you 7. Character Pointers: in C Plus list of the area of character Point is different from other normal pointers. So character pointedly mostly used to point to string literally, since strings are themselves a sequence of characters. And when we tried toe print character pointer, it has behavior is very different from other pointers. So in other pointers is the event in Pointer and we Tried toe Print it. We're is an in. Then it will bring the address that is stored in that point of where is if we compared to character pointers. So it's also storing this see. But when we try to print this, it will bring the actual character fall away. Some random characters. And this randomness is because it expects that all the string little's will be terminated by a null characters or is the creating a character area than the last characters will be done? Little character. Then it will just print those character. Otherwise, it will go on printing or the contents of the memory until it finds and moral character. So these may be very strange characters, so how can we print their dress off the character pointer? So in order to bring that we have to type casting too wide start. So here we have the same example, but instead off directly printing the secret here. We're casting it, too. Worried? Start. So this will print. It can also been just a, but it'll it can also bring some random characters after done because, oh, this is not, uh and in order terminated director in there, and this is just one character. But if we try to cast it toward pointer and then try to print it, it will print the actual address. This is here did with that character? No, let's try to understand String Leatrice, because understanding string rituals is very important for understanding character pointers string literal sorry sequence of characters like this one here. So it's equivalent when area of characters because there is nothing but a sequence of elements in them. But one difference is there. This is not a Terminator. So by noble character, we mean this characters which SK valued you so male characters appended as an early smell character and learned so internally. This string is not a big city, but every city and then followed right now in the last as the last character so This is not a girl in tow. This area, this character. It's equivalent to this character, and it makes a huge difference while using character pointers. You should understand that when you declare it's string literally like this, it's internally this five characters, four characters. So first, let's see the case where we initialize a character pointer with the string neutrals. So we have a character point to see one, and we initialize it with string, literally every city. So the starting address is assigned the first character in the literal. So here a Stephen is. We're skill appointing toe a on, and it's good to use cost care star. Since the String Littles are immutable, who better to write cost people their other way? You make it or warnings during your comparison tresses. You know, let's see some examples, like when we tried to print this even it will print a B Siri, and here it will not pretending out of his characters because it automatically appearance their fifth characters. It's no character in there and on da this steer landforms Ennis oh, defined in such a way that it will return for it, will ignore this last character And when we tried to print side off this character pointer , it will again give it on 60. Forward wasn worried, maybe four. So they're typical sage off pointers on their system. No, let's see another case where we initialize a character. A rivet string literal, sorely result. Ah, we are initialized characters point to it strongly trim. So this is slightly different. So we have a character very and we're in his late pretty recently so internally the compiler experience it as a B C B, and it hurts dismal character in the end. So this is a character with sage flame, so it looks like for but the compel arise internally ordered this null character for it to function correctly for Stringer truth and very then we printed it will correctly print every city and after the trains, this metal character so it will not bring anything. And when we do is to Ireland. This function is defined in such a way that it will take this four characters only, and it will ignore denial character, so it will give a letter for as expected we got. We expect that it should bring this lend Toby for and when we don't say just see to, it will print five the under just four characters, and we have assigned you to character every so we expect there. There are four characters in this era, but it will bring fight because there is one additional character reach of your north. Seeing this is implicit, so it's important to remember it. And here we are, explicitly assigning a character. Eric, toe this character every variable so compiler will not correct it for you. And this is your wrong case, because we may get some undeserved rituals. So here we are saying just four characters when we princey tree. It will print every city, but it's no guarantee darted. We'll just print a visit. You can print some extract electricity because it will stop when it finds inal character, and we have not given it, so it may or may not get and little character after that memory addressed, and this is tear liberal, also not working quickly, and it will print how many characters it finds with or no determination in there, And so, in this case about it, minstry extract electricity in the steer land will keep seven and sage off this seat rebuild distinctly for because we have explicitly ordered four elements to No, let's see all off these in X scored. So this is the case earlier case where we cannot bring their dress using just the CPD here in normal pointers. When we just bring this pointer, it will print an address. But here it will print this a fall away. Some extra characters similarly here and when we want print the address, then we have typecasting. Two words start and then it will print address in this case of Let's run it and see. So here it prints a and it has given some extra line. We have not given any extra new line. We have just one new line character, and it has been entered an extra space in New Lanier and similarly here. And when we costed it, prince that risk correctly. No, this is the first case where we're assigning it to character, pointed the string literally on disk. The compiler implicitly urge one male character so it could clip parents. Even every city and the steer land return fools and side of Stephen returns eight on the system. It can return for on some systems there. Tickle Savior Pointer on that system. And then we have authorities were of your assigning string, literal to a character every so here. Also, this a raise implicitly whirling flame characters and the compiler is there implicitly for us. So here also this will print. Kirkley goes after lead, finds the null character and sage off steer Lend returns for because this has four characters and we see that sage off here. They don't sleep, but we have other this four characters, but we saw there. The compiler will expand it to make it an aerial. Five characters were the last character is in little character, so, in fact, it's an area of five character suit, princely. No, the last case where we incorrectly and explicitly and in just four characters. So here the compiler will not expand our area. We have explicitly returning Mary here. We're just even a string literal, so it's just four characters, and when we try to print it, we see that it printer Davis City. But again it rented some extract erectus because you did not find the milk to an end, and this is to Ireland will exactly return whatever it thinks. The string is so prince here because your things There are eight characters in the string and side of see trees for in this case, Big Old were explicitly earning four characters. So how can we correct this prince? Wrong characters who we have to just I heard one, no character and Lola. It's really only And no, it should be corrected. So we see that these two cases are no same. So whatever compiler did for us and what we explicitly written. So that's all for character points. See you in the next listen. 8. Dynamic Memory - Stack vs Heap: memory is a very concealed resource and understanding how the memories man is very operating system while we're running an application would help was in becoming a better program. So in this video alerts a sturdy board and make no memory. And what are the different segments off memory while in application, is running on water stacks and heaps in these segments? So memory assigned to a program or application, he is basically divided into four segments. Gored, Sigman, Static, Sigmund Stack and he. So the court segment basically stores the instructions that need to be executed. Starting and Global segment maintains the static or global variables, which lifetime is during the entire lifetime off application. Then we have a stack which keeps track off the function calls and local variables and who the scope is not the same as the application a scoop like the global variables. And then we have dynamic memory. So this is the memory when we need a large chunk of memory and the side is not known at the compile time. So such memories managed in the heat. No, let's see what did segments. So when we run any application, then these are the four segments. So the court segment then started or global Sigman and then stick memory. And finally he for these are the four segments. So, uh, so these are ah, quit abuse started, Can court segments. So, for example, ISI, have, uh, this court here c plus for scored Then when this application A starts running many men is the first method that is involved. So is this is our stack that said, this is the stack part of this. So we have expended or this stack six and and then we have the static or global six. And so this is a global variable Jeevan and it will remain in the memory toward this left end of this program. So this Jeevan will come here, though it's a global. So this is the start IQ or global Six. Um on this is stuck. No gunmen starts earning. So this stack is a located during the ah by the operating system when application starts running and its size will not change. So this stack has some memory. Maybe, let's say saving me Then when men starts training than men will be pushed through, a stack for men is pushed here because men has started executing. Then Maynard Variables even so, see, one is there and then it calls if 02 and pass it on Stephen. So no menace executing. But before there, food to needs to return. So for you is pushed in the stack. No, for us this even even be too on one started variable between. So this will remain there. So be three will come in the starting six and And these Beaven and be too will come in this we will and we to because this is the stack through him saying to this sanction if or and any function that is on the top of the stack is currently executing so mean hardest started executing. But men then called if or to sue Mann has not returned yet. First for two will return. Then men will resume its execution. So and these are in this scope off this stack frame and this food because food one so before for two returns for one needs to return and secure. So this is cord, Andi. It's very well, sir. Even you do in a tree. So even if you win a three area and there's some more space in the stack. So if by any means this is stack is full and still really, uh, making some calls, then we will run into stack overflow ism because we cannot expand the same Steck during runtime. So one example could be that we are making some bad Rikers. And so there is some recursive call which is a kind off leading to very bad records in, and we have consumed all the stock memory. Then we can run into this, so no, let's set this apart. Now let's see what will happen. So when this full function completes, it will return, and this stack friend will be freed. So know this. Ah, for one has completed its execution. No food has the value returned to a full one. So after some time, for you will also complete execution. And the report? Gordon, this tech no main function is executing. And finally, this main frontal completed execution and Bassist Extreme will be empty. And this, uh, then, uh, when program terminates these blows anaesthetic sex, and this would also be freed. So this is the typical, uh, leader memories handled. So here we have not talked about this last confident this heat memory. We have talked about these. No, let's see when he comes into picture. No, let's see what is dynamic memory and how we can request dynamic memory at runtime from the ways. So in C, we have functions. My look Gerlach relook earned three for dealing wit. Diana, Magna, Maria Turn time. And when we call any function like my look and then we assign, we pass home anybody, it's we want memory at runtime, so we don't know how much memory is required during the complaint claim. So we need to call these functions to request memory at runtime from the Wiz and these memories. Oh, these memory address addresses are stored in heat, so he is a very large memory food. We call it also three memory, three pull off memory or dynamic memory, and it's much more large compared to these tax in these memory segments. And ah, then we have in C plus nous. We have New Cooperative and Lito Britain for a requesting memory in the So we can also use these in t plus nous because we can call see functions in C plus. Let's also no, let's see some examples so that it's clear. So let's ignorantly this function if one is executing, it said this word over stuck and it hurts some parent from some calls here. And if one is in the top of the stack, that is, everyone is currently executing. And Vidin, everyone we have it pointed be And the is Kristen memory for a turn time or it's rearing. Ah, using CFCs. Then we can request no look, four weights or we can also right side different. So what? This may look noses. So this is over heap sex. Um, this is stuck on this is he. It always will see that I have requested poor bites so it will locate for Bates and give the starting address off this as a point of them. It's a stored in p. So this bees local to this F one. So there will be one variable be in this historic three mawf everyone and it will point here and this is four rates we could also request be to And this time let's civilly Crist. We want ah to allocate the memory to an area of Saiz 100 integers. We'll say 100 times, say different. So it really locate 400 mites. Let's say from here to here and we to the starting address of this will be returned and between a local variable. Careful. So Peter will point to here. No, if ah, the you're sane, be this variable or let's call it even. No serious ain't even equal to. And the request another memory. Let's in my look it so no in new memories located to us in the Let's in this part and notice even is pointing here. But receive there this memories no unused. And this point is not dip even is no pointing here, but this is still in the heap on the application of not get this memory at any point of time because it was thinks that very question off this memory is still using it. But we do not have track of this memory the lost track of that. So there will be a memory leak. And if huge multiple search locations and we're not three in the memory than the application, memory will keep on increasing with train. So here we also need to call free than we have done using the memories. So once the located for marriage to it and we have used that never really no longer needed . Then we need to call three function on their team, going to be one. So this memory will be returned back to do is so it can reassign this memory and the new request comes similarly here. When we're done vetted, we will call free P two for three north this memory. So whenever we request any dynamic memory of John time, they also need to call three explicitly urgent time. We can write a single accordion sleeplessness. So instead, off Melican Court Kellock, we will use the new and delete operators. So does the already requesting memory for one in teacher and so no easier and and looking at some space for when indigenous restoring one teacher so it can report right and nope evenness pointing to the starting address of this and when you're want to our request more memory like we want toe request memory for one area Then we can request it like new and and 100. So it will locate memory for storing 100 teachers and even bill going to the beginning on their tenderness and for freeing the memory they will call, delete, be and delete this. But this is the square braces for people because they're weird. This even is one area off 100 teachers. So this is the difference between deleting a single into your pointer and and at different ages. So wanting to remember that we need to explicitly call the free or delete mattered to free the memory. And when we're using new, then we need to use delete. You cannot use new and then call free on this frieze reserved when we use my local Kalac or re lock on when we're using new operator than we need to call delete. 9. Conclusion - What's next: Congratulations on completing this course on sleeplessness, pointers. Sleeplessness pointers are one of the most fundamental and useful concepts in Jeep listless . And I hope this course was useful for you in understanding sleeplessness, pointers. So with great power comes great responsibility. So you get enormous power with sleeplessness pointers. But you also need to men is the memory. Very well. So don't forget to check my cause on a secret list. Smart pointers. Which does the memory management more effectively for you? They're normal drop winters. Thank you.