C++ POINTERS (2025) - What is a dynamic two-dimensional array? (MULTIDIMENSIONAL dynamic arrays)

Поділитися
Вставка
  • Опубліковано 18 січ 2025

КОМЕНТАРІ • 259

  • @CodeBeauty
    @CodeBeauty  3 роки тому +28

    📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
    C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
    Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
    🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
    Experience the power of practical learning, gain career-ready skills, and start building real applications!
    This is a step-by-step course designed to take you from beginner to expert in no time!
    💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
    Use it quickly, because it will be available for a limited time.

    • @David_gee_the_1
      @David_gee_the_1 2 роки тому

      @CodeBeauty
      Is it possible to create a 2d dynamic array without know the number of columns before hand?

  • @chau2065
    @chau2065 3 роки тому +55

    One of the most intuitive explanation on the dynamic 2d array I've ever seen. Thank you!

  • @정민강-r1s
    @정민강-r1s 3 роки тому +62

    I'm a Korean and have been purchasing other contents of book and videos, but they are almost all rubbish not worth of even 1 cent. I can not understand what rubbish they are saying! Now, I've come to fully understand what pointers and dynamic memory assignment are at once after watching these videos. Your contents are worth of much value and time effort!! I sincerely respect you.

    • @worldshaper1723
      @worldshaper1723 3 роки тому +1

      This is so inspiring!!

    • @eduard289
      @eduard289 3 роки тому +1

      I feel this too !

    • @CodeBeauty
      @CodeBeauty  3 роки тому +5

      Thank you so much! I'm happy that I can help and do something meaningful! 🥰🥰

    • @deepaktalan7219
      @deepaktalan7219 3 роки тому +1

      Same feeling

    • @deepaktalan7219
      @deepaktalan7219 3 роки тому +1

      Lots of respect to your knowledge and the way of presentation

  • @faridtasharofi9131
    @faridtasharofi9131 3 роки тому +20

    Undoubtedly this is the best explanation of "dynamic two-dimensional array" I've ever seen.

  • @zombiehellmonkeygaming1956
    @zombiehellmonkeygaming1956 4 роки тому +19

    Thank you so much for this video. I've been creating dynamic multi-dimensional arrays for hash tables without really understanding why I use double pointers, and for that reason I've been unallocating the memory incorrectly too! Your explanation is very clear and easy to understand, and I love how you used the spreadsheet to demonstrate the concept. It filled a large piece of missing knowledge for me!

  • @Kenforbes3
    @Kenforbes3 Рік тому +2

    Thanks!

  • @gouravchouhan1790
    @gouravchouhan1790 3 роки тому +7

    When you cut those pointers at 5:07 , it just clicked something and I got everything that I wanted from this video. Loved it❤️❤️❤️❤️❤️❤️❤️

  • @akanguven114
    @akanguven114 Рік тому +1

    Superb clarification, God bless you and may the force be with you!

  • @jeanhuberson3635
    @jeanhuberson3635 3 роки тому +8

    Very clear I love the way you explain things you explain and...repeat!

  • @gammyhorse
    @gammyhorse 3 роки тому +3

    You have the talent at explaining complicated programming concepts and help me visualize them and finally understand them. So, I need to tell you.. you should never stop teaching. Thank you very much.

  • @AlexAlex-em6ct
    @AlexAlex-em6ct 4 роки тому +7

    thank you so much Saldina! You save my life. Keep up the great content!

  • @matthewcarlson1748
    @matthewcarlson1748 4 роки тому +7

    Thanks for these tutorials they are very helpful! Keep up the great content!

  • @nhatminhhoang1469
    @nhatminhhoang1469 3 роки тому +1

    I'm a CS student and i can say that you clearly have the best explanation of all videos i have already watched. Completely understood.
    Thank you so much. Keep up the great content please :D

  • @joydeepbanerjee8840
    @joydeepbanerjee8840 2 роки тому +2

    Very helpful content. Please know that people like me recognize the effort you are putting in and appreciate the trouble you are going through to explain these concepts. I have seen many other videos, but have found yours to be hitting all the necessary points i.e., a) mechanism and sequence of allocation, b) visualization of the allocation process c) sequence and importance of the delete operation -

  • @anthonypuffenbarger5725
    @anthonypuffenbarger5725 2 роки тому +1

    This is the most amazing explanation of this concept I've ever seen. Thank you so much!

  • @yusufg.916
    @yusufg.916 3 роки тому +2

    You really are helping the growing programmers like me, I have been watching your videos and they are very helpful to me, because I learn a lot from them, please keep up doing what is good to humanity, you will be rewarded by the Almighty God.

  • @beelover513
    @beelover513 3 роки тому

    EXCELLENT!!!!FINALY,SOMEONE WHO KNOWS ENGLISH,AND COMPUTER SCIENCE!!!!CONGRADULATIONS!!!KEEP UP,THE GREAT JOB,YOU DO!!!!!

  • @kahleryasla
    @kahleryasla 3 роки тому +2

    I have the midterm exam 2 days later and I've been trying to figure it out for 2 weeks; finally, I understood thanks to you

  • @kiddbora
    @kiddbora 3 роки тому +1

    I have a question:
    at 11:20, she writes table[i] , but we are referring to 1st level of pointers there? isnt it supposed to be:
    *table[i] = new int[cols] instead? If we dont put an asterisk and just write table[i], arent we referring to the 2nd level pointer which only holds 00EEEE address here? (memory cells she drew on A column)

    • @kiddbora
      @kiddbora 3 роки тому

      I'm so confused. I kept watching and she writes table[1][2] to access the values inside. Isnt she supposed to write **table[1][2] instead? Pls help :(

    • @kiddbora
      @kiddbora 3 роки тому

      I figured it out. In the previous videos, she also mentions that indexing an array also dereferences it. So when using 1 index, dereferences once, when using 2 indexes in 2D arrays, dereferences twice. no need for asterisks there

  • @lioz8274
    @lioz8274 3 роки тому +2

    The best explanation that I've seen so far!
    This video worth much more than 7K views...

    • @CodeBeauty
      @CodeBeauty  3 роки тому +1

      Thank you so much! I'm glad that you think so! 🙏💙

  • @zombiehellmonkeygaming1956
    @zombiehellmonkeygaming1956 4 роки тому +1

    I'm watching this video again (probably the fifth time) because I just completed a Python then a Java course, and now I need a C++ refresher! Thanks!

  • @labiaJohnken2567
    @labiaJohnken2567 4 роки тому +2

    lucky to watch it at the right time when i was stack from the textbook.honestly, it's well explained .

  • @andriy_bondarenko
    @andriy_bondarenko Рік тому +1

    Thank you! This was an extremely difficult subject for me, but you have clarified it so clearly!

  • @handover007
    @handover007 8 місяців тому +2

    Very well explained. First time I got to understand this well. thanks and keep making programming easier to learn.

  • @1polyron1
    @1polyron1 3 роки тому +1

    Thank you. This video was helpful from beginning to end. You are my favorite teacher. I love the way you teach. You don't over-complicate and make learning fun and approachable. I just get a very nice vibe from you and I truly appreciate your work. I'll do my part where I can to support such talent and vigor.

  • @leilaborromeo
    @leilaborromeo 5 місяців тому

    i've been searching for an explanation for this topic, and you've explained it well! thank you!

  • @iluvmomss777
    @iluvmomss777 Рік тому +2

    omg you just single handedly rescued my finals thx

  • @AlokSingh-gg9wc
    @AlokSingh-gg9wc 3 роки тому +1

    finally, I got the most awesome explanation of dynamic 2d arrays available on youtube. I was really struggling with this topic and surprisingly this is the first time I got your video in recommendations.
    The way you explained the stack diagram is really awesome.
    Ma'am just one request can you make a series of stl along with some cp questions.
    Love from INDIA in these tough times

  • @lionelinx7
    @lionelinx7 2 роки тому +1

    I love this lady so much. She has taught me more than my professors (;-;). Thank you so much!

  • @Makornak
    @Makornak Рік тому

    Got confused reading this from my textbook, your video broke it down so it was much easier to understand. Thanks!

  • @TheyCallMeKevo
    @TheyCallMeKevo Рік тому

    You’re amazing. You make topics that are usually difficult to understand easily understandable. I wish you were a professor at my college, and I’m seriously thankful you decided to share your knowledge (especially for free). I don’t know what I’d do without you. You’re the only UA-cam channel whose ads I don’t skip.

    • @CodeBeauty
      @CodeBeauty  Рік тому

      Thank you so much for your kind words! I'm truly glad that my videos have helped you and made difficult topics more understandable. 🥰❤️‍🔥

  • @Kenforbes3
    @Kenforbes3 Рік тому

    Perfect explanation of C++ dynamic two-dimensional array operations. Thank you!

  • @khumukchamsonam4471
    @khumukchamsonam4471 3 роки тому +1

    Content and the the way u explain is fantastic

  • @kalligi
    @kalligi Рік тому

    This was exactly what I was looking for. The explanation is fantastic, it is clear and I could understand everything at the first time watching. Thank you very much!

  • @simmi641
    @simmi641 7 місяців тому +1

    Crystal clear explanation,loved it ❤

  • @nafables3626
    @nafables3626 3 роки тому

    hey, dropping here to say thankyou for the c++ videos, its helping!!

  • @darksoul6052
    @darksoul6052 Рік тому

    You are one old best teachers I know so far.

  • @abubakarafzal9707
    @abubakarafzal9707 3 роки тому +1

    Videos on these kinda topics are not common on UA-cam. But with this explanation, this video is epic

  • @elpengi
    @elpengi 3 роки тому +1

    This makes so much sense now! Thank you

  • @k2305Pawan
    @k2305Pawan 3 місяці тому

    You dive into concepts, clearing it better than any other videos, that too by a method which never feels hard to learn unlike others (they are good too but you areamazing
    )

  • @BluCasper
    @BluCasper 3 роки тому

    This video a life saver indeed. i have watched all 6 videos on pointers in your pointers playlist. in a word it was incredible. Thanks a lot for the amazing contents. wishing you the best.

  • @1polyron1
    @1polyron1 3 роки тому +1

    That explanation using Excel was simply a beauty. CodeBeauty.

  • @henkfinkers3931
    @henkfinkers3931 4 роки тому +11

    This might seem like a really weird question but could you later expand on the size of your array/table?
    Say I have a 10 elements long array and I want to append an eleventh element. Is this possible or would you need to redefine another array, copy the data over and add your new value?

    • @CodeBeauty
      @CodeBeauty  4 роки тому +16

      No, you can't. Array stores data in continuous memory, and once the memory is allocated, you cannot expand it. So you are right, create a new bigger array and copy the data to it.
      Also, considering that the array stores elements in continuous memory, accessing those elements is a lot faster than accessing elements of a linked list for example, so arrays have both advantages and disadvantages 😊

  • @chippandenga6722
    @chippandenga6722 3 роки тому

    You are the very BEST at explaining these topics. Unbelievable. Thank you so much.

  • @mgr_krowas8919
    @mgr_krowas8919 3 роки тому +1

    Thank you so much! I have struggling with the pointers problem for really long time

  • @dreamscape11011
    @dreamscape11011 Рік тому

    Thank you for everything. You and brocode taught me how to code better than my college teachers. Thanks!

  • @georgemagdy4431
    @georgemagdy4431 4 роки тому +2

    your explanation is very very very clear and simple ......i hope you make a database course with SQL

  • @yashsonawane905
    @yashsonawane905 3 роки тому

    Introduce the problem first and then introduce the solution for it. I like your this approach from the beginning of the c++ videos. Really appreciate your efforts :)

  • @cbanow
    @cbanow 2 роки тому

    Excellent !!!! Congratulation you are really a Great Teacher !!!!!

  • @ElectroMart90
    @ElectroMart90 2 роки тому +1

    Beautifully explained!! Gratias :)

  • @ashur026
    @ashur026 4 роки тому +2

    Thank you so much for the clear explanation. your visualization is what made me understand the concept.

    • @CodeBeauty
      @CodeBeauty  4 роки тому +5

      I know that it is a pretty complex topic to understand, so I tried to make it as simple as possible. It is awesome that visual examples help! 😊

  • @mahmutivanov2336
    @mahmutivanov2336 4 роки тому +2

    Wonderful! Thx for all playlists and videos.

  • @shakshi9108
    @shakshi9108 4 роки тому +1

    Your explanation is the best I found out on yt

    • @CodeBeauty
      @CodeBeauty  4 роки тому

      Thanks. The topic is pretty hard to understand, so I used visual examples to help with that, and it's pretty normal to watch the video once, and then to watch it again in a day or two, or to watch it a few times, so that you remember everything. 😊

  • @sunstrumsharam5388
    @sunstrumsharam5388 Рік тому

    Thanks I finally understand, instead of creating pointers for each row , you create a pointer that point to a pointer that you add bytes of memory into it, so it skip the part that you need to create pointers for each row, thanks alot!

  • @asfandyarkhan3977
    @asfandyarkhan3977 4 роки тому +2

    Thank U So much All of your videos are so helpful. I have learned c++ from your videos.

  • @shreyashiroymedhi1842
    @shreyashiroymedhi1842 3 роки тому +1

    thank you for helping me get rid of the pointers fear :")

  • @amrashour7285
    @amrashour7285 10 днів тому

    iconic explanation 🌟

  • @ezgi.yyt41
    @ezgi.yyt41 Рік тому +1

    thank you so much for this video! Thanks to you, I finally understand multidimensional arrays

  • @Pantsnsocks
    @Pantsnsocks 3 роки тому

    This is such a great explanation! Thank you for showing a clear visual representation of a difficult to grasp concept.

  • @RAHULTMNT100
    @RAHULTMNT100 2 роки тому

    best explanation ever on this topic

  •  3 роки тому

    What a magnificent and beautiful multidimensional array!

  • @handyabrown
    @handyabrown 4 роки тому +1

    Great video! Thinks for explaining in simple terms what a two dimensional array is, and then how to properly create one.

  • @1conscience0dimension
    @1conscience0dimension 3 роки тому

    this is so clear thks. without enthousiastic explanations it would be hard for me to learn this.

  • @gloss1138
    @gloss1138 Місяць тому

    queen you slayed this omfg thank you I finally understand this topic

  • @ahmedhussien2195
    @ahmedhussien2195 8 місяців тому +1

    Thank you this is the best explanation of dynamic dimensional array 👏👏👏

    • @CodeBeauty
      @CodeBeauty  8 місяців тому

      I'm happy to hear that you like it 🥰

  • @semeriyalegesse4543
    @semeriyalegesse4543 3 роки тому +2

    Thank you so much. it is clear

  • @chiragmaini9564
    @chiragmaini9564 3 роки тому

    Crystal clear explanation mam🤩
    Love from INDIA

  • @quanginh4225
    @quanginh4225 3 роки тому

    You made it so easy to understand
    Thanks

  • @anz111
    @anz111 2 роки тому

    I was stumped on an assignment due to the double pointers operator stuff, and thanks to your video I realized it was actually a multidimensional array.

  • @Tonboswimmers
    @Tonboswimmers 3 роки тому

    unbelievably good explanation.

  • @FikiMehi
    @FikiMehi 10 місяців тому

    Thank you my teacher. You are best

  • @ingrid2748
    @ingrid2748 4 роки тому +2

    I just have an exercise about this! I have to make a vector like class without using vector library and working instead with a Dynamic Array. Thanks so much for this!

    • @CodeBeauty
      @CodeBeauty  4 роки тому +3

      That is a very common assignment for students and a very good one. Hope that the video will help. 😊
      And if you want to take it a step further, and really make something to impress, you can use the video about generics that I published a few hours ago and make a more advanced vector-like collection
      vector, vector, vector 🤓

  • @TheJoshuamcgowan
    @TheJoshuamcgowan 2 роки тому

    Pretty rad how you can explain these concepts.

  • @uttamkarmakarece3534
    @uttamkarmakarece3534 3 роки тому +1

    Finally I get a great video on this topic....you explained really well ❤️

  • @BilalAhmad-ps7gj
    @BilalAhmad-ps7gj 3 роки тому +1

    Next Level Explanation 👌🙌

  • @carldewitt1692
    @carldewitt1692 3 роки тому +1

    I can not say thank enough for this video !!

  • @davialbuquerque1880
    @davialbuquerque1880 3 роки тому +1

    Your explanation was better than my professor's

  • @nunu.g
    @nunu.g Рік тому

    OMG i love her she explains very well .🥰

  • @vyomyadav6497
    @vyomyadav6497 3 роки тому +3

    I will say just two word, Thank you.

  • @vujkopopovic3713
    @vujkopopovic3713 4 роки тому +1

    Very helpful. Thank you very much!

  • @pankaj.yadav1
    @pankaj.yadav1 3 роки тому

    Ma'am your explanation is awesome 👌👌

  • @jeetenzhurlollz8387
    @jeetenzhurlollz8387 9 місяців тому

    just beautiful code explanation and tutor

  • @HungPham-ki9wu
    @HungPham-ki9wu 2 роки тому

    the excel explanation is brilliant

  • @mhhstudio1105
    @mhhstudio1105 3 роки тому

    best explanation on multidimensional array with pointers, I am currently struggling with this topic. The used of the excell table at the beginning of the video oreally helps clarify the idea better.

  • @isotectz6368
    @isotectz6368 3 роки тому

    Thank you for the wonderful explanation.

  • @emuejevokesalvage8802
    @emuejevokesalvage8802 2 роки тому

    Thanks a great deal. Finally resolved the problem with my code.

  • @myvehicle5602
    @myvehicle5602 3 роки тому

    claver teaching .....thank you very much!!!

  • @YUMYUMINMYTUMTUM
    @YUMYUMINMYTUMTUM 5 місяців тому +1

    Best video over internet

    • @CodeBeauty
      @CodeBeauty  5 місяців тому

      Thanks, I'm happy to hear that 🥰🥰

  • @Vincent-ht7eb
    @Vincent-ht7eb 3 роки тому

    At firt I just wanted to add a little comment and then it appened what you can read below:
    Thanks for all.
    I lerned a lot with you. The most about arrays and vegetables 😉.
    As a lot of your followers I really like the way you teach with the the well accent you get, the great moves you do (sometimes I can see directly the memory spaces on the top of you finger when it's describing it) and the simple but powerfull way you use interfaces you use to show it (VS, excel sheet, ...).
    And I'm agree with you that knowing many programing languages is logical when beeing a developer. And learning a new one can help to understand an other already know but not 100% understood.
    And know I have an important question for me: how to deal with the differents methodologies we have today for developing? Every job's offers say that we should know "developing on an agile environment" but I read many about srum and I used unitary tests but they doesn't fill well my need. Because they doesn't give me a good way to structure my program, my classes. Yes for me using Test Driven Development or/and Scrum looks like not enought and will finally lead the structure of the program falling to bullshit.
    So I searched and found DDD for Domain Driven Design. And this methodology gave me my missing tool. But nobody know it and nobody use it. 🤣
    So I would say the best methodology sould be using an agil method like Srum with DDD and checked with unit tests. But it could be nice having your point of vue on this topic.
    I've looked this tutorial for DDD:
    openclassrooms.com/en/courses/6121861-apply-a-domain-driven-design-approach-to-development/6353721-adapt-your-diagram-to-changing-client-needs
    And then I have read this book: DDDvitefait.pdf (because I'm a french speaker and I didn't found an other synthetic tutorial in english on this topic).
    Again thanks for your passion 👍

  • @biglognyabadeng2495
    @biglognyabadeng2495 3 роки тому

    I'm very excited for the awesome algorithm of codding your utilizing in your tutorial

  • @viratsrivastava8734
    @viratsrivastava8734 3 роки тому

    Thanks a lot ma'am u don't know how much u helped me in my backtrack and graph algo.i was stuck in the dynamic allocation

  • @jadraad6171
    @jadraad6171 2 роки тому

    This is one of the best

  • @muadrico
    @muadrico 4 роки тому +9

    Any reason, why you used NULL instead of nullptr?

    • @CodeBeauty
      @CodeBeauty  4 роки тому +24

      This is a good question. 😊
      NULL approach was passed from C language, and now that you are asking, to be honest it's better to use nullptr.
      In this particular situation you'll not find any difference, but there were some situations when NULL was causing amiguity in overloaded functions in C++. That was a few years ago, and maybe that problem is fixed now.
      If you are not familiar with what overloaded functions are, you can watch this video ua-cam.com/video/5OUttXvf6hw/v-deo.html
      And then you can answer me what happens if you pass NULL as an argument to overloded function. 🤓😊

    • @ashur026
      @ashur026 4 роки тому

      @@CodeBeauty so we don't have to use null?

    • @CodeBeauty
      @CodeBeauty  4 роки тому +19

      Use nullptr ☺️

    • @WistrelChianti
      @WistrelChianti 3 роки тому +5

      @@CodeBeauty and there was me always using zero ;)

    • @zaq12wsxqwop
      @zaq12wsxqwop 3 роки тому

      0 == NULL

  • @MoTharwat-sw2dc
    @MoTharwat-sw2dc Рік тому +1

    YOU ARE THE BEST!

  • @joysarkar8696
    @joysarkar8696 2 роки тому +2

    Most beautiful explanation I have ever seen. You explained everything in a simple and understandable way that win my heart for you. Thank you!

  • @talm5568
    @talm5568 2 роки тому

    Hi.
    Thanks for all the great cpp tutorials. I would be very happy if you will get into the cpp networking topics.

  • @davidmwangi4312
    @davidmwangi4312 3 місяці тому

    Best explanation👋

  • @leagueofpopoy
    @leagueofpopoy 3 роки тому

    This is very helpful!!! THANK YOU VERY MUCH!!!

  • @yapayzeka
    @yapayzeka Рік тому +1

    cristal clear 👌

  • @hanaessam6990
    @hanaessam6990 3 роки тому +1

    YOR'RE A LIFESAVER