Pointers to Pointers in C/C++

Sdílet
Vložit
  • čas přidán 19. 04. 2013
  • See complete series on pointers in C / C++ here:
    • Pointers in C/C++
    In this lesson, we have described how we can create pointers to pointers and use them in our code.
    For practice problems and more, visit: www.mycodeschool.com
    Like us on Facebook: / mycodeschool
    Follow us on twitter: / mycodeschool

Komentáře • 334

  • @meenakshisundaram3533
    @meenakshisundaram3533 Před 4 lety +251

    7 years and till I couldn't find a better tutorial than this.

    • @chlyrics8890
      @chlyrics8890 Před 4 lety +2

      yeh you right this man concepts end....

    • @iswarrana5697
      @iswarrana5697 Před 3 lety

      Yah!

    • @rdius4822
      @rdius4822 Před 3 lety +1

      Javidx9 has a really good tutorial on pointers. Consider watching it.

    • @amritaanshnarain7524
      @amritaanshnarain7524 Před 3 lety +3

      Way too much time taken to understand pointers. LOL

    • @_rtdp_
      @_rtdp_ Před 3 lety

      😂😂😂... So true...

  • @ayaan5786
    @ayaan5786 Před 9 lety +151

    Few days back i learned pointers in my c++ institute and i was confused about the concept, and now after watching this tutorial i can say i know what pointers are and how they are stored in a memory.
    Thank you very much!!!!

  • @rupeshaggrawal6954
    @rupeshaggrawal6954 Před 3 měsíci +2

    4 years after I completed my Graduate and watching it to revise my pointers concept and believe me, still can't find any better video than this.

  • @mycodeschool
    @mycodeschool  Před 11 lety +10

    Thanks Samir, for noticing. Yes, it should be 205. . I have added a note as correction.

    • @mohithrgowda8682
      @mohithrgowda8682 Před 2 lety

      how to dereference pointer to pointer using arrow operator

  • @N4nowledge
    @N4nowledge Před 7 lety +5

    although i m in a reputed institution of engineering but your channel is above all educators ...
    with no buttering and humbly praising that u are awesome educator and u have god gifted talent of teaching which is not possessed by many teachers ..
    may u be blessed ..

  • @mycodeschool
    @mycodeschool  Před 11 lety +6

    Thanks Vaibhav ! Valid suggestion. I thought of doing so initially, but video was getting long and i thought of doing it in another lesson. Stay tuned and keep interacting. :)

  • @marinalance8198
    @marinalance8198 Před 7 lety +5

    Excellent video, clear and full explanation of the details. Pointers are one of the most important topics in C++ so it's a hassle when they don't explain properly in class. Thank you!

  • @MohitK96
    @MohitK96 Před 8 lety +63

    your diagrams are the only cause that pointer to pointer entered my brain properly :)

  • @meanmole3212
    @meanmole3212 Před 10 lety +1

    Amazing videos you have here. These topics have always been somewhat mysteries to me and I never bothered to learn them quite well. I highly appreciate your visual way of presenting things as you speak, it has helped me a lot. Thanks for the effort!

  • @mycodeschool
    @mycodeschool  Před 11 lety +5

    Sometimes, pointer variables may be holding an important information. If you know of linked list, there is a head pointer that stores the address of the first node. Now, lets say we declared this head as a local variable in main method and want to modify it in some other function. So,we can pass head by reference. Called function will receive a pointer to pointer. Let's say method reverses list. Signature will be void Reverse(Node** head);. *head will give access to "head" in main method.

  • @atanatirosgiliat954
    @atanatirosgiliat954 Před 10 lety +15

    Pointers are quite confusing to me but you are making them seem easy. Great teacher.

  • @stewartrogerson1369
    @stewartrogerson1369 Před 4 lety

    The best ever description, hours of book confusion solved in your video, well done!

  • @tholo.nkadimeng
    @tholo.nkadimeng Před 9 lety +5

    This was more useful than I had hoped it would be. Thank you so much

  • @ThePaullam328
    @ThePaullam328 Před 8 lety +63

    This is an excellent video. Ironically it explains the concept 100 times better than my university profs

  • @thatmehdude
    @thatmehdude Před 2 lety

    This is series has been really good so far. Pointers have been kicking my ass and I hope my confusion would be gone or greatly reduced by the time I'm done with this series

  • @oddeven327
    @oddeven327 Před 5 lety +3

    Got an exam tomorrow, been binge watching the playlist. So far so good.

  • @debk4516
    @debk4516 Před 5 lety

    Awesome . You're superb . I came here to brush up my knowledge on Data Structure and Pointers to prepare for ML interviews and I found this tutorial really helpful . Thanks a lot !

  • @ishaqaminu5099
    @ishaqaminu5099 Před 8 lety +3

    Thank you very much for the clarity of your explanations May God bless you.Please keep on helping people like us with clear explanations like this..

  • @kushshah4442
    @kushshah4442 Před 9 lety +7

    Thanks a lot sir ! It helped me a lot , never thaught pointers can be this much easy !

  • @NikitaKoselev
    @NikitaKoselev Před 2 lety +1

    Amazing. The whole series is amazing. Finally, somebody has structured what I have kinda known about how pointers work. You are my personal hero now. You and Trisha Gee and some other nice people :)

  • @devendudileep1149
    @devendudileep1149 Před 3 lety

    You are sooo good.I never knew pointers could be this easy,thank you, I am surely going to recommend you to anyone who says pointers are tough.

  • @robl39
    @robl39 Před 10 lety +53

    dear mr mycodeschool-
    another well done tutorial. thanks for all of these!!!
    - C student

    • @anujkhare3815
      @anujkhare3815 Před 4 lety

      you mean mr animesh or mr late harsha.

    • @anujkhare3815
      @anujkhare3815 Před 3 lety

      @Govind yeah.he died in a car accident , was one of the best coders from india

  • @vasubhatt6160
    @vasubhatt6160 Před 5 lety

    you are a master dude... no comparison. you have so damn good understanding of all the concepts. salute mate.

  • @saraaldossary5453
    @saraaldossary5453 Před 6 lety

    One of the best channels for C/ C++, Thanks a lot

  • @crazyconan28
    @crazyconan28 Před 6 lety +1

    Thank you for your clear and concise mini lecture!

  • @signoregatto6061
    @signoregatto6061 Před 5 lety +1

    Tis' but a piece of cake with your clear explanation. My professor puts me to sleep in 0.00000025 seconds. Thank you very much!

  • @rohan4035
    @rohan4035 Před 2 lety +8

    At 5:40, shouldn't r have the value 205 instead of 215 at memory address 230? My reasoning is that since int*** r = &q; then r will have the value as the memory address of q which is 205.

    • @sanketmarathe4686
      @sanketmarathe4686 Před rokem +1

      It's typing mistake i think

    • @rodrigopintof948
      @rodrigopintof948 Před rokem +1

      I noticed the same.. I was looking for this observation in the comments to confirm. Peace of mind is back.😜

  • @marcussmithwick6326
    @marcussmithwick6326 Před 7 lety

    Your teaching method is far superior to all the other videos on youtube ive seen

  • @shivani_raul
    @shivani_raul Před 3 lety +1

    This is really so much more helpful than the rest of those explaining Pointers. Till date you are the best💪 😌

  • @begood2454
    @begood2454 Před 4 lety

    Now,I've understood why cs dojo has recommended your channel.

  • @lakhdeepsingh5883
    @lakhdeepsingh5883 Před 6 lety +1

    Thank you Animesh..You're really helping lakhs of students

  • @HarpreetKaur-wt1kl
    @HarpreetKaur-wt1kl Před rokem

    My professor taught me about pointers but I couldn’t understand his topic at all. I watched many of the videos but nothing helped me . Fortunately, I found your video and it clears all my doubts and I understand the pointers. Thanks very much 😊

  • @mycodeschool
    @mycodeschool  Před 11 lety +4

    Hi Magdy,
    Structures were used in 'C' to create user defined complex data types with multiple fields. We cannot declare functions within structures in C. As we moved to C++, struct was kept as a keyword and can be used in an object oriented manner just like class. So struct in 'C' are different from struct in 'C++'. in C++, struct are just like classes. They can have functions inside them as well as other object oriented features like inheritance. contd to part 2...

  • @ahmadmaroof2809
    @ahmadmaroof2809 Před 8 lety +36

    At 7:52 minute, I guess value at r should be 205 instead of 215.

  • @hunterbowman5150
    @hunterbowman5150 Před 6 lety

    I watch a lot of coding videos, yours are very high quality, thanks!

  • @mycodeschool
    @mycodeschool  Před 11 lety

    You are always welcome. Please post your question.

  • @Jeshhafterhours
    @Jeshhafterhours Před 10 lety +7

    thnks a lot dude may god bless u :) u made me a pro in c

  • @rishikabera93
    @rishikabera93 Před 10 lety +1

    loved the video..now the concepts are crystal clear :) .thanks a lot!!

  • @alexsece
    @alexsece Před 7 lety +1

    Thank you !
    Also thank you for raising the audio level!

  • @GeorgeRodes1968
    @GeorgeRodes1968 Před 8 lety +4

    Excellent Work. Thanks a lot!

  • @_rtdp_
    @_rtdp_ Před 3 lety

    Your fabulous visual representation is the reason I understood pointer to pointer to pointer...

  • @williamwambua7710
    @williamwambua7710 Před 3 lety +1

    These are the best tutorials

  • @WinterSina
    @WinterSina Před 8 lety +3

    Thank you for explaining this. I was struggling how int** p; was being used. I assume we can do this by creating a 2D pointer array now?
    Thank you for your hard work.

  • @robinburkard5134
    @robinburkard5134 Před 7 lety +1

    your videos are great, better explained than our teacher :)

  • @mohammedhamid6059
    @mohammedhamid6059 Před 9 lety +5

    way of explanation is very good... Thanks a lot and keep uploading...!!! :)

  • @shindoxxx
    @shindoxxx Před rokem +1

    I think my professors should watch your videos as well, so that they might actually know what they are talking about in the lectures.

  • @vaibhav384
    @vaibhav384 Před 6 lety

    Great video,really helped me clear my doubts,Thank you.. A playlist for this section would have been great..

  • @gamer-sama7769
    @gamer-sama7769 Před 5 lety

    Great explanation and visual, thank you!

  • @michaellimboo4980
    @michaellimboo4980 Před 8 lety +1

    thanks sir its been really helpful for grapsing the concept of pointer clearly....

  • @snehalgurav3599
    @snehalgurav3599 Před 4 lety

    All concepts are cleared!!...your videos are awesome.😇... thanks

  • @sallyazzam6565
    @sallyazzam6565 Před 3 lety

    now I can really say that I understood what those pointers mean .thank u so much !!!,couldn't explained it better .

  • @md.sayedhassansourav3215
    @md.sayedhassansourav3215 Před 8 lety +1

    Allah may Bless you Sir :) !!! All of your videos explained related topics very clearly

  • @labbaikmediastatus
    @labbaikmediastatus Před rokem

    I really find this helpful in 2023, with the best basic to advance level explanation. Can anyone please tell me why the creators of this youtube channel are not posting new content on this channel?

  • @DharmaTruthDuty
    @DharmaTruthDuty Před 8 lety +79

    You are wrong in part where you mentioned the content of 'r'
    r should hold the address of 'q' which is 205.
    The diagram should be changed.

    • @pravinnaga3524
      @pravinnaga3524 Před 5 lety

      Anup Amin yah bro correct r should hold an value of 205

    • @SwapnilSarkar
      @SwapnilSarkar Před 5 lety +11

      @@pravinnaga3524 Dude that comment was 3 years old. Lol!

    • @Luigi-lk4uf
      @Luigi-lk4uf Před 4 lety

      @@SwapnilSarkar 🤣🤣 🤣 🤣 🤣

    • @allenjoseph6848
      @allenjoseph6848 Před 4 lety +13

      It's a minor human error. Cut him some slack and appreciate his work brother.

    • @m.preacher2829
      @m.preacher2829 Před 4 lety +2

      @@SwapnilSarkar never to late to give a correct answer xD

  • @rakshitks7850
    @rakshitks7850 Před 5 lety

    You are awesome ....your lectures are mindblowing ..keep up the good works and thankssssssssssssssssssssss a lot for all these

  • @krishnaraj9855
    @krishnaraj9855 Před 5 lety +2

    sir u r best..i like ur video before watching,,,thank you so much sir.

  • @azend889
    @azend889 Před 2 lety

    Thanks for this video, man.

  • @abanerjee3704
    @abanerjee3704 Před 3 lety

    This is just phenomenal....

  • @bhumipatel9617
    @bhumipatel9617 Před 9 lety +3

    thank u sir....its really helpful......thank u once again.....

  • @sonwabo2011
    @sonwabo2011 Před 10 lety

    Thanks a lot for your tutorials, they are realy very good, keep it up.

  • @sumitkumar-vn4xk
    @sumitkumar-vn4xk Před 7 lety

    Today i can say i have know something about pointers. By diagram and taking in account how addresses and values changes in each step is appreciating one. # thanks..mycodeschool

  • @michaelpatterson1096
    @michaelpatterson1096 Před rokem

    Great review. thank you

  • @olivierhouben
    @olivierhouben Před 10 lety +1

    really useful . keep going mate .

  • @sagarshah275
    @sagarshah275 Před 8 lety

    Excellent explanation...thanks!

  • @toyganyilmaz
    @toyganyilmaz Před 4 lety

    very clear and excellently done

  • @Sourav_Debnath
    @Sourav_Debnath Před 9 lety

    Thanks for this lesson.....awesome sir.

  • @marcoyolo1095
    @marcoyolo1095 Před 2 lety

    very intuitive explanation thanks

  • @spicydoge3847
    @spicydoge3847 Před 5 lety +1

    You're a savior

  • @Xgamesvidoes
    @Xgamesvidoes Před 4 lety

    This finally makes sense! XD
    But these are one of the so many things where I am thinking about, when do we really need this.
    Thanks for the good explanation!

  • @mycodeschool
    @mycodeschool  Před 11 lety +2

    You got it right buddy :)

  • @tanandrew8383
    @tanandrew8383 Před 8 lety

    Great video. I got this problem of understanding pointers and after your video, I am so clear of pointers to pointers now***_***

  • @nikhilgumidelli6308
    @nikhilgumidelli6308 Před 9 lety

    Really good explanation!!!

  • @mrpwnr24
    @mrpwnr24 Před 8 lety +2

    Thanks, strait to the point like how you question how you explain as well.

  • @niharikapatel8284
    @niharikapatel8284 Před 7 lety +1

    Do we have any tutorials of c++ as well? your tutorials are really helpful. if any please let me know

  • @lokeshroy3944
    @lokeshroy3944 Před 4 lety

    Great explanation.♥️♥️♥️♥️♥️♥️

  • @imranshareef7605
    @imranshareef7605 Před 6 lety

    thanks a lot sir for making it in such a cool way..

  • @mariembenzineb4522
    @mariembenzineb4522 Před 6 lety

    thank you so much , i finally understand pointers

  • @mycodeschool
    @mycodeschool  Před 11 lety

    contd... Here head in Reverse function is local and of type Node**, while head is main is local and of type Node*. Now, when main calls Reverse, it will call like Reverse(&head); So, Reverse will receive the address of head in a pointer to pointer and access head in main as *head. So, if it writes *head = something, it modifies the head in main method. Let me know if you still do not get it.

  • @soumikdutta77
    @soumikdutta77 Před 5 lety

    very well explained sir !

  • @sudiptadhar9794
    @sudiptadhar9794 Před 6 lety +1

    We can perform arithmetic addition on void pointer. I have checked in linux environment. Kindly look into this matter. Thank you

  • @abhilakshyamehta1634
    @abhilakshyamehta1634 Před 3 lety

    Best tutorial ever

  • @ilgapr24
    @ilgapr24 Před 11 lety

    Thanks a million!

  • @MalTheWelcomer
    @MalTheWelcomer Před 6 lety

    Great video. thanks a lot!

  • @vinpan88
    @vinpan88 Před 8 lety

    You Guys are awesome!!

  • @arijitbagchi2197
    @arijitbagchi2197 Před 9 lety

    you are the best!!!!thank u!

  • @arjumandvillagecooking

    nice explanation👍👍
    great🌷

  • @MohitSharma-tt3uk
    @MohitSharma-tt3uk Před 4 lety +1

    More videos on algorithm techniques and c++
    Please.......

  • @tigerboom9030
    @tigerboom9030 Před 3 lety

    It will be probably usefull in recursion, recalling the pointer of a pointer... and etc.

  • @letien827
    @letien827 Před 3 lety

    very clear know.Thank u

  • @yichizhang795
    @yichizhang795 Před 9 lety +2

    Thanks!

  • @Aabara_ka_dabara
    @Aabara_ka_dabara Před rokem

    today, i found these lectures and feeling glad.... thankyou for providing such lectures..

  • @techblog1491
    @techblog1491 Před 4 lety

    Nice turorial!

  • @khalidguled5525
    @khalidguled5525 Před 4 lety

    Thanks for the late night help :)

  • @3g1991
    @3g1991 Před 8 lety

    good explanation!

  • @krishnakhandelwal9466
    @krishnakhandelwal9466 Před 3 lety

    I think your name crystal because your teaching is crystal clear.

  • @mahmoudamin8534
    @mahmoudamin8534 Před 7 lety

    you're pretty gooood .. Thank you

  • @testacc9381
    @testacc9381 Před 9 lety

    One of the professor at my college taught linkedlist's insert node funtion using pointer to pointer concept like this void addbeg(node ** start,int x) ..can you please explain in short about it

  • @vaibhavgupta6u
    @vaibhavgupta6u Před 11 lety

    thanks for the nice video and quick reply......
    One suggestion, whenever You explain any topic pls explain it's significance and real time application like above....Human mind is greedy it doesn't catch the things until and unless it gets the reason of adopting them.....

  • @kedarpednekar9582
    @kedarpednekar9582 Před 4 lety +17

    At 7:33 r=205 not 215.....But great video dude!

  • @shinvou
    @shinvou Před 5 lety

    You are redefining CS by having two different bytes at the same address (Minute: 0:52, memory address: 201/202). :D Apart from that, good video I guess! But remember kids: There is more! That stuff like a mapped kernel berfore of this any address range (and the kernel also isn't the first information in your mem), 32/64 bit, pages, ASLR and much more fun. :)