Pointers and arrays

Sdílet
Vložit
  • čas přidán 19. 02. 2013
  • See complete series on pointers here • Pointers in C/C++
    In this lesson, we will discuss the relationship between pointers and arrays.
    For practice problems and more, visit: www.mycodeschool.com
    Like us on Facebook: / mycodeschool
    Follow us on twitter: / mycodeschool

Komentáře • 268

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

    Thanks a lot :) this teaching model is already famous, if you have heard of Khan Academy.

  • @abhisheksingh-rd2ur
    @abhisheksingh-rd2ur Před 8 lety +225

    There can't be a better teacher than you.......my concepts are so clear now.

    • @suneelabbigari
      @suneelabbigari Před 7 lety

      what if i use int A[5] , in formal argumrnt ? is this same int* A[5] ? both are not same ?
      what would be the problem if i use ?

    • @venkateswarans1012
      @venkateswarans1012 Před 5 lety

      You won't get any compilation error, but its gonna be an undefined behaviour

    • @dharmang
      @dharmang Před 5 lety

      hyperbole lmao xD

    • @FreeMayaTutorials
      @FreeMayaTutorials Před 3 lety

      @@suneelabbigari You don't know what's located memory location 220 in this example. It'll compile but the output will be unknown.

    • @FreeMayaTutorials
      @FreeMayaTutorials Před 3 lety

      This is a great tutorial, thanks!

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

    Thanks a lot for the encouragement.

  • @lindawisebear
    @lindawisebear Před 7 lety +55

    This was beautifully explained; the best video I've seen on this topic! I like how you give plenty of examples and explain every single line of the examples you give clearly. Thanks from a c beginner!

  • @bamster64
    @bamster64 Před 6 lety +3

    This series of tutorials are probably the best programming tutorials on CZcams, short but extremely well explained, how it should be.

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

    The MyCodeSchool pointer series is the best/ most accessible explanations about pointers that I have seen in the galaxy!.

  • @leixun
    @leixun Před 4 lety +36

    *My takeaways:*
    1. Data in arrary are consecutive in memory 0:13
    2. Assign an array to a pointer is equal to assign the memory address of the first value in the array to the pointer 4:20
    3. How to get the memory address and value of an array element 5:03

    • @syedhamid01
      @syedhamid01 Před 2 lety

      Thnx

    • @Rahulsingh-theraha
      @Rahulsingh-theraha Před rokem

      thank you for quick recapping

    • @ua2894
      @ua2894 Před rokem

      chinese guy learning from indian guy? how charmingly quaint!

    • @JulieTech
      @JulieTech Před 2 měsíci

      @@ua2894 Neighbors sharing together....Hahahaha..

  • @utkarshaggarwal1631
    @utkarshaggarwal1631 Před 4 lety +4

    The way you always link the concepts with the memory they use, makes it a whole lot clearer. that's where I always had doubts about its actual working. You are something else. Thank you!

  • @mdabusayeed2305
    @mdabusayeed2305 Před 7 lety +36

    I am ashamed of my Univ Teacher after watching these lectures. A long time nightmare is become a piece of cake.

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

    I watched this before and let me tell you that your explaining is really amazing.This is the best explaining so far

  • @palaksarawagi9290
    @palaksarawagi9290 Před 7 lety

    Thank You ! sir , concepts are getting clear now.
    Each and every tutorial of your is so clean and to the point.

  • @xz7525
    @xz7525 Před 4 lety +1

    Amazing explanations!! I hope these lectures continue to spread to many more people!

  • @Deepak-ce4bb
    @Deepak-ce4bb Před 3 lety +4

    One of the best teachers I've come accross so far in my life.

  • @juannov7
    @juannov7 Před 2 lety

    Super clear and great examples, time to watch all your videos! THANK YOU!!

  • @suigetsuhozuki1
    @suigetsuhozuki1 Před 4 lety

    Thank you very much for these lectures! Right now I'm watching these videos, typing your code alongside and taking notes; will go through this playlist one more time so the concepts sink in :)

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

    best tutorial for pointers and arrays, each and every concept is simply explained, keep it up sir 👍👍

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

    Thanks man for uploading these valuable lectures. These are pure GOLD..

  • @kevinl1080
    @kevinl1080 Před 2 lety

    This was great thanks! I am doing my first programming course in Computing Science and this video helps a lot

  • @faithdame4823
    @faithdame4823 Před 6 lety

    Thank you so much for this. I been having difficulty trying to understand pointers. This was really helpful.

  • @ammarm7
    @ammarm7 Před 9 lety +61

    Man your soo awesome, its finally clinking! Im gonna nail my exam tomorrow!!! Thank you.

    • @iTech1337
      @iTech1337 Před 7 lety +7

      did you nail it ?

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

      he probably failed , why else hes afraid to confess us the result :D

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

      Lol same. Mine is the day after tomorrow

    • @dhruvkaran9724
      @dhruvkaran9724 Před 4 lety +3

      @@poljakov13 madrasa education only fails u.

    • @peterpace3379
      @peterpace3379 Před 3 lety

      @@dhruvkaran9724 Being in VIT, I can confirm this is true.

  • @justinli19901027
    @justinli19901027 Před 8 lety

    so well explained!! give a million thumbs up if I can!! Best tutorial channel on youtube!!

  • @aadypillai5808
    @aadypillai5808 Před 4 lety +85

    im cryin i can literally feel my brain getting bigger

  • @somnathgarai
    @somnathgarai Před 10 lety

    no one taught pointers and arrays concept like this... great learning experience and made the concept clear

  • @OmarChida
    @OmarChida Před 6 lety +2

    I LOVE YOU ! LEARNNING NEW THINGS HERE!

  • @Submersed24
    @Submersed24 Před 7 lety +2

    very good tutorial, thanks! feels so nice finally understanding this...

  • @nivo6379
    @nivo6379 Před 4 lety +1

    Thank you for this course and the playlist.

  • @jeelkumarbaraiya5109
    @jeelkumarbaraiya5109 Před 5 lety

    Great sir!! You are providing best conceptual learning with smoothness and easiness.

  • @sachinnihalani8150
    @sachinnihalani8150 Před 6 lety

    One cannot be more precise than u sir . Ty very much it helped me a lot

  • @TheThelifegame
    @TheThelifegame Před 4 lety

    amazing , simple , clear , and straight forward

  • @shitalunde24
    @shitalunde24 Před 4 lety

    i had never understood this clearly ,but now my all doubts are cleared.thx for that .plz upload playlist on arrays , structure and union

  • @somentebruno
    @somentebruno Před 7 lety +18

    thank you for the subtitles

  • @shalupathak6905
    @shalupathak6905 Před 5 lety

    You are osm..really... I was so much scared of doing programming.. But now I am doing good in it.. Thank you 😊 😊

  • @kaizhang9530
    @kaizhang9530 Před 5 lety

    The series too good that I always forget to give a like before move on to next video!!

  • @vaishalijoshi7642
    @vaishalijoshi7642 Před 6 lety

    concepts and communication skill executing simultaneously....hatsoff

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

    This Video lectures helped Me a lot. So thank you for that

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

    basic concept but your lessons are very helpful!!! thank you!

  • @junot9007
    @junot9007 Před 5 lety

    this was so clear and helpful; thank you!

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

    Thank you for such a wonderful video ..its really beneficial and informative ..thanks once again..

  • @SravanKumar-us5lw
    @SravanKumar-us5lw Před 6 lety

    Your Lecture is Good !ThankGod Yu Saved me from Internals

  • @bencroacademy
    @bencroacademy Před 6 lety

    Pointers are amazing man.. I love how that..just changes a variable in..void

  • @CODINC
    @CODINC Před 8 lety

    Thanks man, u r a great teacher. Im subscribing to u now!

  • @thiagaodavez5465
    @thiagaodavez5465 Před rokem

    really good, i was very confused about the relationship between array and pointer, now its clearer

  • @brettjay
    @brettjay Před 8 lety

    Really like this one; crystal clear!

  • @deveshmeena5481
    @deveshmeena5481 Před 3 lety

    you just made it so much easier to undertsand. THANKS

  • @wcxjordan9859
    @wcxjordan9859 Před 8 lety

    So great!!
    Really good teaching!

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

    Thanks a lot!
    Damn I understood everything I need from this and ur character and array video. I was very confused from the "char *argv[]" thing.

  • @AbhishekSingh-yr5uq
    @AbhishekSingh-yr5uq Před 6 lety

    thanks it is very nice and simple ways of teaching the difference between them keep up the good work

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

    Thank you animesh for the explanation. :)

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

    thank you very much for this video, it was very helpful :)
    - new subscriber

  • @melancholiethelab9478
    @melancholiethelab9478 Před 5 lety

    Thank you for making this tutorial.

  • @bhzo2010
    @bhzo2010 Před 11 lety

    Thanks a lot..
    --
    you are doing excellent work..

  • @thsdsyt
    @thsdsyt Před 4 lety

    This was very clear, but It would be a good idea to make a video about the few differences between an array and a pointer.
    Thank you very much!

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

    really excellent explanation

  • @tamilmaranc
    @tamilmaranc Před 7 lety

    its very clear thank u so much....Just declaring two variable and storing in particulate address and printing the address and variable value which u could initialized

  • @thomash7247
    @thomash7247 Před rokem

    Thanks sir, your explanation is great

  • @suigetsuhozuki1
    @suigetsuhozuki1 Před 4 lety

    This is very important topic. "Equivalence" of pointers and arrays (though they are not really equivalent).

  • @alialhilo5696
    @alialhilo5696 Před 4 lety

    what u did is really amazing bro !!

  • @rakshitks7850
    @rakshitks7850 Před 5 lety

    Awesome as usual....very informative

  • @AdityaChandak287
    @AdityaChandak287 Před 7 lety

    Great tutorial!

  • @praxisdev1884
    @praxisdev1884 Před 7 lety

    You're my hero.

  • @enkhnyambattulga9351
    @enkhnyambattulga9351 Před 3 lety

    how are you such a brilliant teacher omg

  • @sakibjobaid6667
    @sakibjobaid6667 Před 6 lety

    this is a tremendous good video i have ever seen !!!!

  • @pinkipandey159
    @pinkipandey159 Před 5 lety

    Outstanding Sir... Truely thankfully

  • @medjefe2255
    @medjefe2255 Před 5 lety

    thank you so much finally pointers are clear for me .

  • @blandiblue
    @blandiblue Před 4 lety

    Thank you very much my beloved friend.

  • @taymurahmed7119
    @taymurahmed7119 Před 9 lety

    Sir, you are just awesome...

  • @ShauryaChawlaprayforplagues

    Thanks for the video!
    *NOTE :- Printing the address of the first array element like printf("%d", A); doesn't work in case of linux users who use build-essential.

  • @Eld0g5
    @Eld0g5 Před 11 lety

    Amazing, very very helpful :D keep the excellent work plz!

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

    #Awesome tutorial sir😃😃😃😃😃😃
    Thank you

  • @aspireshekar
    @aspireshekar Před 8 lety

    nice one abhishek keep extending...

  • @jbbotha
    @jbbotha Před 4 lety

    Fantastic! Thank you.

  • @kartikpanicker9275
    @kartikpanicker9275 Před 7 lety

    God bless you master......

  • @sajidmohammad5947
    @sajidmohammad5947 Před 3 lety

    *for anyone who needs an example for when array and pointers are used together, you can take a look at this.
    The question is "arrange array in ascending/ descending order using functions"
    #include
    void ascending(int *p);
    void descending(int *p);
    int main()
    {
    char seq;
    int a[10] = {10,2,4,6,8,1,3,5,7,9};
    printf("Do you want ascending or descending sequence?(a/d)");
    scanf("%c",&seq);
    if(seq == 'a')
    ascending(&a);
    if(seq== 'd')
    descending(&a);
    for(int i= 0; i

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

    pointer variable generally mentioned in ptr instead of mentioning "p"

  • @epochalanaxagorasworldpeac8053

    You are so good !!!!!!!!

  • @linf31337
    @linf31337 Před 8 lety

    Thank you for your video :)
    i have a question, what are the differences between
    this code to view an element in an array, why would
    you use one over the other
    printf("%d",a[3]);
    printf("%d",*(p+3));

  • @Shiva-zy7jq
    @Shiva-zy7jq Před 5 lety

    Thank you so much sir. Video was really helpful

  • @mounikadesai2513
    @mounikadesai2513 Před 9 lety

    thanks a lot for these tutorials understood d concept of pointers for d 1st tym :D

  • @mastercode7851
    @mastercode7851 Před 4 lety

    thanks for the lesson

  • @chiragnandaniya3133
    @chiragnandaniya3133 Před 6 lety

    Thanks sir it helped a lot!!

  • @corporalwaffles
    @corporalwaffles Před 8 lety

    Excellent video

  • @masterchef8671
    @masterchef8671 Před 8 lety

    U saved my life !

  • @bamokinamoandadestin7888

    you did a good job!!!!

  • @pjliu6329
    @pjliu6329 Před 2 lety

    thanks for your video.

  • @meshuz398
    @meshuz398 Před 2 lety

    Thank you!

  • @OlatunjiOdelade
    @OlatunjiOdelade Před 7 lety

    waooo!! this tutorial was excellent

  • @maniabedii2574
    @maniabedii2574 Před 5 měsíci

    Thank u, Helped a lot

  • @megb3513
    @megb3513 Před 7 lety

    Thank you so much!!

  • @XurshidDev
    @XurshidDev Před 6 měsíci

    Thank you very much

  • @07bhas
    @07bhas Před 11 lety

    Hi! Thanks for the lectures.
    In the ed, you mentioned that you cannot directly increment the base address of an array (say for example 'A') as A++. But isn't it similar to doing A+1? And the operation A+1 works! could you explain this?

  • @rakeshreddy9417
    @rakeshreddy9417 Před 6 lety

    Awesome teachings ... and it is very very useful for beginners to understand the concepts easily..
    Moreever the subtitles are some what not good because of the black background. We are unable to see the things behind that.. please ... make alternate..

  • @yashaswiification
    @yashaswiification Před 10 lety

    awesome tutorial

  • @markpascual100
    @markpascual100 Před 5 lety

    SUPER HELPFUL

  • @bukarorolo
    @bukarorolo Před 9 lety

    ur the man dude

  • @jumaelahmed9995
    @jumaelahmed9995 Před 2 lety

    May our creator bless you teacher!

  • @AnilKumar-np2ez
    @AnilKumar-np2ez Před 5 lety +1

    Thanks for array in pointer

  • @deepTh00ught
    @deepTh00ught Před 3 lety

    thank you very much

  • @lakiza55
    @lakiza55 Před 8 lety

    Many thanks

  • @danieleke1400
    @danieleke1400 Před 5 měsíci

    Thankyou so much mehn

  • @sharonslibrary
    @sharonslibrary Před 7 lety

    First of all i appreciate what you are doing sir, its Great. I wrote the same codes and instructions as in the video but i didn´t get the same results though, instead of the adress allocation and values of each Array , i´m gettin the sum of the numbers and their position
    the code;
    #include
    #include
    int main()
    {
    int A[ ] = { 2, 4, 5, 8, 1 };
    int i ;
    for (i = 0; i < 5; i++);
    {
    printf("adress = %d
    ", A + i);
    printf("value = %d
    ", *(A + i));
    }
    system("PAUSE");
    return 0;
    }