C++ POINTERS (2025) - How to use pointers and arrays (for beginners) PROGRAMMING TUTORIAL

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 159

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

    📚 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.

  • @sayaleeambulkar8863
    @sayaleeambulkar8863 3 роки тому +40

    Everything seems easy when taught by you😌

  • @licinio3
    @licinio3 3 роки тому +15

    I saw several videos in this channel and I think it is a great course/s to learn, to remember several essential concepts of programming. Great! Many thanks :)

  • @sofiavaleriatorochambi4234
    @sofiavaleriatorochambi4234 2 роки тому +6

    This just blew my mind, I'm learning c++ for a project, the reference code I found is so confusing so I was just watching some youtube videos to understood, and yours is really well explained, thank you! It was an absolute mind-blowing to me 🤯❤

  • @making.fronds
    @making.fronds 2 роки тому +6

    I'm starting my final year papers at uni, my algorithms and data structures paper uses c++ and the way they explain things is soooo much more confusing than you do!! I felt like you explained linked lists SO well that I'm going to watch this whole pointers series, even tho I've already learnt them, I don't fully get it. I hope you have content for all the other topics we learn!! Thank you!!

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

      I'm sure that you'll learn si much from this course, and that all the pieces will come together and complete your knowledge of pointers ☺️☺️

  • @silverstar3417
    @silverstar3417 3 роки тому +10

    Finally, I have found the best teacher in the world!

  • @muhammadumernadeem725
    @muhammadumernadeem725 4 роки тому +27

    Beautifully explained + You said Derefrenciate 5 times.

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

      Hahaha, I filmed a couple of videos that day and edited only this one so far. I hope that there will be no "derefrenciate"-s in the other ones. 🤭

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

      @@CodeBeauty These minor mistakes doesn't matter in front of all the efforts you are putting in these videos.

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

    Thanks!

  • @optane3336
    @optane3336 4 роки тому +8

    you're soo underrated you deserve a lot more subs than you have right now

  • @AKhan-3
    @AKhan-3 3 роки тому +11

    One solution for the last part is to use: sizeof(luckyNumbers) or luckyNumbers.size() in the for loop condition.
    So we can avoid accessing memory location not belonging to us.

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

      It will cout 20 instead of 5, try
      int getArrayLength = sizeof(myNumbers) / sizeof(myNumbers[0]);
      cout

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

    I know you mention it's tough recording video's while trying to break the language barrier. I have no issue understanding anything you say nor do I even notice the little thing's that you mention in these pop ups about some mispronounced word. I never even notice and I'm grateful that you took the time to do it in such a manner. I would have missed out had this been in any other language as I'm unable to speak any other myself. Cheers!

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

    Thank you very much!!!! The best classes I've received.

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

    For the first time in 4 months, I'm finally able to understand pointers thanks to you.

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

    One of the best course's I have ever find! tnx a lot from Iran❤️

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

      I'm happy to hear that. Many greetings for you! 🥰🥰

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

    Thanks for the great video! Minor nitpick/addition (from my understanding, please correct me if I'm wrong!) regarding the array overshoot at 10:07:
    The data accessed there is "not ours" in the sense that it doesn't belong to the array, but it's not really "someone else's" in the sense that it belongs to another program - the memory belongs to the program being run. If you try to access memory outside of that allocated for your program you'll get a segmentation fault - you can try this out by overshooting the array by a larger number (2000).

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

      did as you said!! got this " Exception thrown at 0x009A6010 in Pointers and arrays.exe: 0xC0000005: Access violation reading location 0x00F61000.
      " thanks!!!

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

    Thanks a lot
    Now I finally understand them
    I Feel I'm ready for tomorrow's final exam

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

    thank you so much,your voice is so nice even it leads me to understand easily

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

    Such an amazing explanation. I was checking on a very well know online course, specifically for how to combine Pointers and Arrays and they include Stack and Heap in the explanation trying to clarify but that was really confusing then I found this video and this is very concise, straight to the point and very well explained, I loved it. Now I am ready to continue with me C++ project 😊

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

    excellent explanation, you answered all the questions I had about pointers with arrays and taught it perfectly for beginners! 👏

  • @GitMike
    @GitMike 3 місяці тому +1

    Thank you for the help, explained it very well.

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

    Very thorough videos... Thanks!

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

    5:18 what hotkeys do you use to comment out the highlighted text?

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

      Hold Ctrl and pres K and C 😊

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

    Very good video. I learned something new!

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

    Excuse me teacher system(pause>0) What's it means? please kindly explain thanks.

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

    Best coding lesson ever

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

    Ca you explain more clearly why we should be careful with memory allocation?

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

    these course are very clear and the language is clear to for french guy

  • @thedarkbountyhunter7592
    @thedarkbountyhunter7592 6 місяців тому

    This is the best video i could find, thx ma'am 🎉🎉

  • @Gary-vo9rm
    @Gary-vo9rm 3 роки тому +2

    I haven't used c++ or computers in 15yrs. Kinda interesting to refresh -- especially from such a babe!

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

    Thank you so much ma'am. You really make programming very fun and interesting.

  • @agreensh
    @agreensh 4 роки тому +4

    Just to note, your last example (going past the end of the array) may cause a crash, and not do the cout (depends on the memory layout eg the pointer could go into reserved memory).

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

      Good point! In higher-level languages this is handled, in C++ you have to take care of it yourself and must not go out of the index range of the array. 🙌

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

      @@CodeBeauty That's Operation System's main job, put borders between applications :)

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

    Could you please explain the line 'system("pause>0")'? I know what it does but I'd like to know more about the syntax. Thanks!

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

      Sure, here is a video about that 😊
      ua-cam.com/video/VcLMLEw4sn8/v-deo.html

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

      @@CodeBeauty Thank you very much!

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

    wonderfully explained

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

    5:18 what do you press for commenting the lines Saldina?

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

    I understood perfectly 😊😊 thank you

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

    I have exam tomorow you just saved me
    Arigato 🙏

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

    curly brackets are shortened for pointers, the long usage is *(luckyNumbers + 2) and short representation for this same is luckyNumbers[2] .
    Functionality of that two is exactly this same, but second one a lot of times is misunderstanding by new peoples who start learning C++ and C. Peoples teaching arrays forget to mention that this is dereferencing pointer style, that so important stuff causing peoples who try to learn it are doing mistakes in programming and have hard time to fixt that. Especially when function come in to play. Passing array of pointers using that quotation luckyNumbers[2] cause problems, when is time to deference it.

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

    easy to undesratnd excellent tutorial + the tutor is very very beautiful

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

    Do you by chance have a video covering sorting and searching values through an array?

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

    Whoaa this sure will do a great job tomorrow in my exam lol. Awesome explanation!

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

    a nice video tutorial again, thanks :) But please keep going to make videos about pointers more such as how to pass it to function as a parameter, how to create char pointers.

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

      I already have filmed videos related to some of those topics. I just haven't edited 'em yet. 😊

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

      @@CodeBeauty very cool, so we are going to watch them soon :) I don't know how much effort do you spend for edit videos but you look expert to teach us these topics :)

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

    You are simply the best

  • @becomplextobesimple
    @becomplextobesimple 4 роки тому +4

    Could you make a Stl tutorial ?It will be great!

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

    Awesome explanation :D

  • @ViralVideos-nf1gl
    @ViralVideos-nf1gl 2 роки тому

    mam we need full course of data structure and algorithms with C++
    your method of explanation is very clear
    need this course very badly as soon as you can mam we all viewers will be very thankfull of you
    and i have already started this university but for me its not very helful so that why this course will help alot of students

  • @107vijayanand4
    @107vijayanand4 3 роки тому

    Thank you so much.Its very useful and easy way to understand programing language. we want more languages videos like python full course

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

    how would I print those values from last element with index 4 to index 0

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

    What are you using that puts in all those spaces in the code? I really like that you can just keep typing.

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

    I love your explained too much keep going 🇪🇬

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

    I wish I found this channel sooner lol

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

    Great Video! I just have one confusion about the usage of the "system("pause>0");" at the end of the main function. Why is it being used as this is not a GUI application where the pause is important?

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

    how do you make the terminal pop up with visual studio code when you run the program?

  • @lolroco
    @lolroco 4 роки тому +4

    gracias estaba en el borde de la locura

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

    Please what IDE were you using here?

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

    what an explanation mam! ❤️

  • @chrisg.5507
    @chrisg.5507 3 роки тому

    Do you have a video of removing blank spaces in a sentence

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

    Dang. That one's a good explanation for pointers and references.
    One question, lists doesn't have element invocation using square brackets. Can we use *(array+integer) to traverse on it?

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

    @codebeauty 0:52 how do you put space between characters like that? whats the keyboard combination please?

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

      its the IDE doing it, you should avoid those type of practices, in fact, it's recommended to learn to code on a text editor such as Vim, mcedit etc when you are learning so you can learn the good habits from the start.

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

      @@luzten programmers are lazy bro yk

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

    Saldina please how do you make the program read the first index of an array as one?
    That’s if you are writing a program for inserting a value at a specified position in an array and you don’t want the output to be strange to the user.

  • @rejhanpuskar
    @rejhanpuskar 4 роки тому +4

    Do you also do paid training for C++ beginners?

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

      I used to work as a programming instructor on paid courses in my free time, but I don't have enough time now, so I don't do it anymore. 😊

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

    Hi..what is the meaning of👇
    system("pause>0");
    return 0;

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

    @CodeBeauty Please keep going, learning a lot, this is really the best channel when it comes to learn C++, kindly can you plase in the future make tutorials about CMake and Unit Testing in C++?

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

    if someone just want to learn c# and web development does learning C++ will help him a lot ?

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

    Thank You so much

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

    Love your videos! I actually understand what is going on! lol

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

    Just out of curiosity: Is there any reason to use those clumsy, uneasy and non-canonical C-Arrays over std::array and std::vector? Most of the discussed problems in size-assertions, usage in range-based-loops and most importantly conversion from T[ ] to T* in return statements are solved for about a decade. In all other regards a very good video, just append the reference to std::array in a prominent place if possible.

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

    So what is the _point_ of using the ampersand, if you can access the address without it? Or is that just for arrays?

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

    Jel mogu privatni časovi kod tebe

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

    Thank you mam this is very helpful for me 👍🥰

  • @526sunny6
    @526sunny6 2 роки тому

    thanks for helping me

  • @JD-eb5qu
    @JD-eb5qu 2 роки тому

    Great explain

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

    Help a lot, thank u!!

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

    A nice lecture.

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

    5:19 what is the short cut to comment all the lines at once?! O.O

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

      ctrl+k and then ctrl+c. to uncomment the selection press ctrl+k then ctrl+u

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

    I love you so much

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

    thanks for the video

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

    Thanks for this video! Can you do videos on vectors too?

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

      The luckyNumbers[5] array is a vector, as it has only one dimension.

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

    Are there any videos for arrays 😪

  • @manjeet_rajput_95188
    @manjeet_rajput_95188 3 дні тому +1

    why are you always using system pause line in the end of the code

    • @CodeBeauty
      @CodeBeauty  2 дні тому

      Hey, there is a video about that on my channel. Just search for "system pause codebeauty" and you can watch the explanation with examples 😃

  • @kaankosti1279
    @kaankosti1279 4 роки тому +4

    ım so happy that i found you your code is gorgeous like you

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

    ok your earned my sub

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

    very understandable

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

    Thank you a lot .. just thanks

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

    Subscribed! I would like to see more on arrays and c-strings

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

      Hi 🤗
      Check out my Data structures playlist. I have a video related to arrays there 😊😊

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

      @@CodeBeauty SImp

  • @alyaqistina597
    @alyaqistina597 11 місяців тому

    thankyouuuuuuuuuu😭

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

    Thanks

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

    she is catching up to Bucky! Great video tho!!

  • @animatedzombie64
    @animatedzombie64 4 роки тому +21

    i already know c++, i'm only here to video.like++ && video.views++; love you!

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

    Thank you mam🙏

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

    Hi Saldina! Will you be covering more advanced stuff like data structure & algorithms in future?
    Pozdrav iz Hrvatske!

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

      That is the plan 😉
      Veliki pozdrav iz Mostara! 🇭🇷🥰

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

      Hey pozdrav means congratulations in English?

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

      @@becomplextobesimple Hej and pozdrav are synonyms and mean hi or hello

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

    ~5 "differentiates" 😉
    For beginners - favour vector over array.

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

    This isn't working for me, instead of outputting the numbers there are adresses outputted

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

      Hi, try to compare your output code with mine
      for (int i = 0; i

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

      ​@@day4834 Hi, thank you for your response:) I don't know where the problem is but I did it the way it is shown in the video and it just doesn't work. I'm putting in two values (it doesn't work with one value either) as it is a 3x3 Matrix but no success (I want to compute the determinant). Unfortunately I can't really post my code here as it is for a HW and my professors check for plagiarism.

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

      @@Sisa095 Hi simonay, understood. Sorry I can't help here, this seems to be the Laplace Expansions for the Determinant which I'm not particularly good at.

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

      @@day4834 Thank you nonetheless:)

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

    Good

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

    This was for beginners?

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

    is succesfull code :
    char arr[] = {'a','b','c','d','e'};
    for(char* pointer = arr; *pointer != arr[4]; pointer++){
    cout

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

    Thanks very much for your video! Explanation was easy and useful to understand. Subscribe ++

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

    Ave Saldina

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

    Wow!

  • @Rain-ml6td
    @Rain-ml6td 4 роки тому

    Can you make a toturial about ploting a curve? Like Develop a program that plots the curve y = 4x3 - x4; for x from -10 to 10
    in an increment of 0.5. I really need to know it, nextweek is our finals.

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

    will somebody give her a clap *clap**clap**clap**clap*