Pointer Pointing to an Entire Array

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 110

  • @DrOggy67
    @DrOggy67 3 года назад +62

    This is maybe the most important lecture of the whole C course... Thanks a lot for this great explanation!

    • @hetaeramancer
      @hetaeramancer 3 года назад +4

      no, most important is the fiorst couple of videos

  • @motivationmastery2327
    @motivationmastery2327 3 года назад +21

    Noone could have ever taught this as much as clear as you did!Salaam Rocky bhai!!! Love you 3000!

  • @Dalia2Lily
    @Dalia2Lily 4 года назад +50

    NESO Academy, I can't stop loving you guys

  • @santiagomunez1347
    @santiagomunez1347 2 месяца назад +1

    If anyone wants to learn pointers and arrays in C, you've come to the right place. This is the best video I've found on RUclips.

  • @sayaknandi139
    @sayaknandi139 3 года назад +12

    You guys are really good teacher and i m telling from my heart u made my programming concept more clear...For your videos i do not need a private tuitor..Thanks a lot

  • @azubuikedanielezeadim4019
    @azubuikedanielezeadim4019 3 года назад +2

    Oh my God! since i have being having problem with pointers, this is the first channel that gave me a better, clear and gently explaination, not even my prof

  • @prototype18
    @prototype18 3 года назад +7

    You guys are seriously doing a good job
    Thank you Neso Academy!!!
    Keep up the good work!!!

  • @saurabhtiwari287
    @saurabhtiwari287 3 года назад +4

    Sir like Or subscribe ke alawa kuch or bhi h kya idhar bta dena koi.
    Literally sir ye topic smjhne ke lye meine thousands of money institute me spend kra h.
    Or aab yahan pr smjh me aaya h.
    Sir I pray to God aapki jholi khusiyo se bhar de. 😇😇😇

  • @yashjaiswal83
    @yashjaiswal83 4 года назад +6

    thank you neso you cleared my doubt very very well!!

  • @axolet
    @axolet 4 года назад +31

    Roses are red
    Violets are blue
    Neso's the best tutor for you

    • @pradhanan9413
      @pradhanan9413 3 года назад +2

      Doesn't rhyme but its true❤️

  • @khoileminh5710
    @khoileminh5710 3 года назад +2

    Your visual explanation is so helpful, keep it up!

  • @janardhanreddyboyalla2941
    @janardhanreddyboyalla2941 4 года назад +5

    Very Useful For Us Sir. Keep going like this sir. Thank You

  • @vimalathithand917
    @vimalathithand917 Год назад +2

    Such a wonderful video! Thanks a lot for providing such a quality content free of cost

  • @ss24567nsingh
    @ss24567nsingh Год назад +1

    Thank you so much neso academy for making such wonderful and helpful videos on different programming languages ..hats off to u..❤❤

  • @abhishektanwar2460
    @abhishektanwar2460 3 года назад

    Thank You for existing Neso Academy.......the problem which disturbed me for the whole day solved in 5 Minutes.

  • @yesvee7377
    @yesvee7377 3 года назад +10

    Please make a course, I'll pay you to signup for it, from my heart i saying this, the example and visualization you gave for pointer to array was not even in the books, hatsoff for your wonderful wonderful work.
    This country needs more teachers like you guys in IITs and IIM's

  • @sdk28
    @sdk28 3 года назад +2

    Pointer is the thing which can get you high.
    It's really strong!

  • @adamjahani4494
    @adamjahani4494 4 месяца назад

    5 mins of learning with Neso Academy is worth a full week learning from my professor.

  • @ericgroen253
    @ericgroen253 2 месяца назад

    Good explanation!!! I'm having a lot of troubles understanding Pointers and Pointers with arrays. This coms in very helpful

  • @SerhatAtes
    @SerhatAtes 3 года назад +6

    int (*p)[5] = &a; -> below printf outputs are the same because base address of first element of the array and base address of the whole array are the same;
    printf("%p", p);
    printf("%p", *p);
    printf("%p", a);
    printf("%p", &a);

  • @ku_Alok
    @ku_Alok 4 года назад +4

    what a superb explanation i love it

  • @khushiyadav6138
    @khushiyadav6138 3 года назад +3

    Thanks for uploading such a nice video 🙂. Explained beautifully ❤️

  • @santasingh9045
    @santasingh9045 3 года назад +1

    Great Explanation

  • @xiangli9588
    @xiangli9588 3 года назад +1

    Thank you. This helped me understand arrays.

  • @mohammadsayem2257
    @mohammadsayem2257 4 года назад +2

    Great explanation...

  • @shubhamrahinj6864
    @shubhamrahinj6864 Год назад

    These c series is simply exceptional & mind blowing

  • @hetanhawke1695
    @hetanhawke1695 5 лет назад +4

    u r the best

  • @adityanpanchal6976
    @adityanpanchal6976 2 месяца назад

    it helped me to understand that concept @4.14

  • @shiksharawat6948
    @shiksharawat6948 Год назад

    Thank u so muchh you don't know how much you helped me at this confusing concept 😢❤lots of love

  • @somasekhardakala2630
    @somasekhardakala2630 5 лет назад +8

    good explanation and thank you🤝

  • @bhawnasingh926
    @bhawnasingh926 4 года назад +2

    Finally got it !!!!!......Thanks

  • @harie8035
    @harie8035 2 года назад

    Thank you from the core

  • @Aabara_ka_dabara
    @Aabara_ka_dabara Год назад

    informative lecture....

  • @abhishekm1903
    @abhishekm1903 4 года назад +1

    Excellent Work

  • @stevewilsonraj
    @stevewilsonraj 3 года назад +1

    the best explanation !

  • @shivampatel8850
    @shivampatel8850 2 года назад

    I like your explanation and please never not stop making such videos

  • @anjalirajeev1054
    @anjalirajeev1054 4 года назад +1

    Thank u 💯💯💯💯

  • @tayyab.sheikh
    @tayyab.sheikh Год назад

    Amazing ❤

  • @sujaymallick2202
    @sujaymallick2202 3 года назад

    Elaboration is really lucid !

  • @harmankaur3938
    @harmankaur3938 2 года назад

    because of you guys i got addicted with C❤️

  • @mohankrishna2875
    @mohankrishna2875 2 года назад

    Very nice explanation sir 🙂

  • @mhj.xd7
    @mhj.xd7 Год назад

    short and clear

  • @anrukshrajput
    @anrukshrajput 2 года назад

    The video was interesting and easy to understand, I want to know how to get access to second and third element of array directly.

  • @funnyanimation888
    @funnyanimation888 3 года назад +1

    This s real education

  • @manthanparekh6490
    @manthanparekh6490 Год назад

    Please also explain for 2D array

  • @shreyasingh222
    @shreyasingh222 3 года назад

    thanks for this useful video.....

  • @lakshanchamod1208
    @lakshanchamod1208 Год назад

    woow sir thanks

  • @akshaycharjan6384
    @akshaycharjan6384 3 года назад

    Thank You Sir :)

  • @prajnasuresh2876
    @prajnasuresh2876 3 года назад +6

    *p is not a pointer, it's the value to which 'p' is pointing(*p is de-referencing the value precisely) whereas p is a pointer. correct me if I am wrong?! we are usually confused reading *p as a pointer, well but it's not!!

  • @MohamedMagdy-pt5zo
    @MohamedMagdy-pt5zo 4 года назад

    Thx for your help

  • @asmakhan541
    @asmakhan541 4 года назад +3

    ThAnk u thanku thank u thank u sirrrrrr thousands time thank u from pak

  • @AdityaBharti23BRS119
    @AdityaBharti23BRS119 11 месяцев назад

    how can we use sizeof() function to get the size of "the whole array" using this "pointer that points the whole array"?
    I was trying to get length of array by somehow getting the sizeof("the whole array pointer")/sizeof(array[0])
    can we do so without using for loops?

  • @ganeshraj541
    @ganeshraj541 3 года назад

    why we are not same ampersand in two-dimensional array?
    For example:
    in one d array:
    (*p)[5]=&a;
    but in two d
    (*p)[5]=a;
    what is the difference?

  • @tejastej2762
    @tejastej2762 3 года назад

    Superb

  • @What_I_Make
    @What_I_Make 5 лет назад +2

    Good understanding regarding the zones, now all I need to do is understand why do it.

  • @qandos-nour
    @qandos-nour 4 года назад

    thank you

  • @JKA-sf7ll
    @JKA-sf7ll 3 года назад

    &a is address of entire array
    a is address of 1st element of array

  • @mehulshah9027
    @mehulshah9027 4 года назад +4

    how to print other elements ???

    • @SerhatAtes
      @SerhatAtes 3 года назад +1

      *(*p + 1) -> print the second element of the given array

    • @pradhanan9413
      @pradhanan9413 3 года назад

      @@SerhatAtes correct

  • @aladdinxd3902
    @aladdinxd3902 3 года назад +1

    3 din se dimag ghumgaya❤️

  • @indian3451
    @indian3451 5 лет назад

    Plz make a video on DMA

  • @satyamsharma5181
    @satyamsharma5181 4 года назад +1

    Sir can u make a separate video on how to pass the entire array to any function and to return it back to main()
    And how to declare these type of array

  • @nileshpokale862
    @nileshpokale862 3 года назад

    Enemy down. All cleared.

  • @Thetejano1987
    @Thetejano1987 5 лет назад

    I understand the concept of it and how to use it but I do not understand why it is must be declared as int (*p)[5]. Can you please explain?

  • @mca_waala
    @mca_waala 2 года назад

    Nice

  • @animeshsrivastava5067
    @animeshsrivastava5067 6 месяцев назад

    int (*p)[5] = a; should be done , instead of using &a

  • @adityaraje7015
    @adityaraje7015 2 года назад

    Can pointer be stored in array if yes please give me syntax

  • @hetaeramancer
    @hetaeramancer 2 года назад +1

    what if i've written *p[6] or *p[4] for that matter? whereas the array has 5 elements.

    • @tomaszstanislawski457
      @tomaszstanislawski457 2 года назад

      it would not compile because `int[6]` and `int[5]` are not compatible types

  • @devToumeh
    @devToumeh 3 года назад

    thx but how to call the second value ?? withoud adding ++ i mean *p[1]

  • @compilerrun5516
    @compilerrun5516 4 года назад +3

    When the address of first element and the whole array is same then why do we need to put "&a" instead of "a" ?

    • @anhminhnguyen4522
      @anhminhnguyen4522 4 года назад +5

      Because by default "a" is the pointer to only the first element (or sub-dimensional array) of the "a" array not the whole array itself, this shall have further implications when we move on to more advanced C techniques. That's why we use "&a" instead. If you stick with his intuition regarding the operation of "*" and "&" operator you can interpret "&a" as "coming out of the first element's memory block to get the general address of the whole array"

    • @revanthvarma2000
      @revanthvarma2000 4 года назад

      @@anhminhnguyen4522 Thanks for the clarification

    • @emmanuelandre2807
      @emmanuelandre2807 2 года назад

      @@anhminhnguyen4522 hey can you give us an example when this occur that the adress "a" and "&a" are note the same

    • @suniel007
      @suniel007 2 года назад

      @@anhminhnguyen4522 But a and &a both have same address.

  • @ase6817
    @ase6817 10 месяцев назад

    why can we just leave out the & and write int*p=a instead of int*=&a or int*p=&a[0]

  • @user-vn9ld2ce1s
    @user-vn9ld2ce1s 2 года назад

    Well, someone should've told us this a long time ago...

  • @adityasaxena6619
    @adityasaxena6619 5 лет назад +4

    int a[5] ={1,2,3,4,5};
    int (*p)[5]= &a;
    int (*p)[5] =a;
    if we replace line 2 by line 3 still output remains same.Why so??

    • @krishnachaitanyareddygujju2823
      @krishnachaitanyareddygujju2823 4 года назад +14

      &a : address of whole array
      a : address of the first element of the given 1-d array; this can also be written as &(*a)
      coming to your question; in this context a and &a are equal because when we store address we store the base address here base address of a and &a are same.
      but however ; a and &a are very different.

    • @whenthethebeansstrikeback6728
      @whenthethebeansstrikeback6728 4 года назад

      @@krishnachaitanyareddygujju2823 Makes sense

    • @SerhatAtes
      @SerhatAtes 3 года назад

      @@krishnachaitanyareddygujju2823 very well explained

  • @shabeerkhan379
    @shabeerkhan379 5 лет назад

    Suppose the length of array contains 10 elements.is it possible to point a pointer only 5 elements in those array??

    • @AjeetKumar-he9lk
      @AjeetKumar-he9lk 5 лет назад +4

      No, if you have got an 1D array of 10 elements. By putting * and &, we are transitioning dimensions (shown as boxes) and not half or full of an array.
      But also...
      Yes, if you talk about a 2D array of 10 elements (i.e. two 1D array of size 5). For that:
      int a[2][5];
      int (*p)[2][5]=&a; // &a is for whole array
      So,
      p is pointer to whole array
      *p is pointer to 1st 1D array which is of 5 elements (voila, got it!)

    • @behindthescene4406
      @behindthescene4406 3 года назад

      @@AjeetKumar-he9lk bro I didn't get how &a is pointed pointed by (*p)[5] ...I mean how 5 elements pointing to &a ....they must be individually pointed by array of pointers ...plz some clear tis doubt

  • @swapnilprantamistry
    @swapnilprantamistry 3 года назад

    Hi there, what will happen for these statements?
    int arr[5] = { 1, 2, 3, 4, 5 };
    int *ptr = arr;
    for(int i=0; i

    • @harmankaur3938
      @harmankaur3938 2 года назад

      here *ptr is pointer of first element of the array 'arr'
      so according to the for loop condition, ptr means the pointer (containing the address of element) will get pre incremented and post incremented, and after that the value will be contained. thankyou

  • @EverythingTechWithMustafa
    @EverythingTechWithMustafa 5 лет назад +1

    Sir notes plzz

  • @syedyousufhussain2725
    @syedyousufhussain2725 3 года назад

    what if i want to print second element of array

  • @kells137
    @kells137 Год назад

    without you I wont graduate

  • @nickolaisimmons4638
    @nickolaisimmons4638 3 года назад

    First 57 seconds better at explaining that most other videos lol

  • @adolfocarrillo248
    @adolfocarrillo248 4 года назад

    So "a" is equal to a pointer to an integer because "*(&a)" is the same as "a" right?

  • @Hiyori___
    @Hiyori___ 4 года назад

    ok so if we do printf( "%p", p ); and printf( "%p",*p ); we get the same result as an hexadecimal value because it's an address

  • @andistheinforitbutso7513
    @andistheinforitbutso7513 3 года назад

    Ssalute

  • @DaiMoscv
    @DaiMoscv 2 года назад

    Think outside of the box 🤣

  • @dineshchintu9779
    @dineshchintu9779 4 года назад +2

    :)

  • @sashah1454
    @sashah1454 2 года назад

    what

  • @shampabhattacharya5125
    @shampabhattacharya5125 4 года назад +1

    Who r the dislikers ? 🖕

  • @rede_neural
    @rede_neural 2 года назад

    This is crazy lol

  • @vigneshsvicky2110
    @vigneshsvicky2110 3 года назад

    :-)

  • @mehulgour5417
    @mehulgour5417 4 года назад

    :)