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
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
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. 😇😇😇
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);
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
*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!!
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?
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"
&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.
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!)
@@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
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
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 TH-cam.
This is maybe the most important lecture of the whole C course... Thanks a lot for this great explanation!
no, most important is the fiorst couple of videos
Noone could have ever taught this as much as clear as you did!Salaam Rocky bhai!!! Love you 3000!
NESO Academy, I can't stop loving you guys
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
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
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. 😇😇😇
5 mins of learning with Neso Academy is worth a full week learning from my professor.
Roses are red
Violets are blue
Neso's the best tutor for you
Doesn't rhyme but its true❤️
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);
yes its correct whats the problem
Good explanation!!! I'm having a lot of troubles understanding Pointers and Pointers with arrays. This coms in very helpful
Pointer is the thing which can get you high.
It's really strong!
You guys are seriously doing a good job
Thank you Neso Academy!!!
Keep up the good work!!!
Very Useful For Us Sir. Keep going like this sir. Thank You
thank you neso you cleared my doubt very very well!!
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
Such a wonderful video! Thanks a lot for providing such a quality content free of cost
Your visual explanation is so helpful, keep it up!
Thank You for existing Neso Academy.......the problem which disturbed me for the whole day solved in 5 Minutes.
Thank you so much neso academy for making such wonderful and helpful videos on different programming languages ..hats off to u..❤❤
These c series is simply exceptional & mind blowing
what a superb explanation i love it
*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!!
Thank you. This helped me understand arrays.
Thanks for uploading such a nice video 🙂. Explained beautifully ❤️
it helped me to understand that concept @4.14
Great Explanation
Great explanation...
good explanation and thank you🤝
I like your explanation and please never not stop making such videos
because of you guys i got addicted with C❤️
Thank u so muchh you don't know how much you helped me at this confusing concept 😢❤lots of love
Thank you from the core
u r the best
Elaboration is really lucid !
Finally got it !!!!!......Thanks
Excellent Work
The video was interesting and easy to understand, I want to know how to get access to second and third element of array directly.
the best explanation !
&a is address of entire array
a is address of 1st element of array
Very nice explanation sir 🙂
ThAnk u thanku thank u thank u sirrrrrr thousands time thank u from pak
This s real education
Good understanding regarding the zones, now all I need to do is understand why do it.
short and clear
Please also explain for 2D array
3 din se dimag ghumgaya❤️
informative lecture....
thanks for this useful video.....
int (*p)[5] = a; should be done , instead of using &a
Enemy down. All cleared.
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
hello bro have you solve your problem?
Same
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?
how to print other elements ???
*(*p + 1) -> print the second element of the given array
@@SerhatAtes correct
Thank You Sir :)
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?
When the address of first element and the whole array is same then why do we need to put "&a" instead of "a" ?
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"
@@anhminhnguyen4522 Thanks for the clarification
@@anhminhnguyen4522 hey can you give us an example when this occur that the adress "a" and "&a" are note the same
@@anhminhnguyen4522 But a and &a both have same address.
Amazing ❤
Well, someone should've told us this a long time ago...
Thank u 💯💯💯💯
Thx for your help
what if i've written *p[6] or *p[4] for that matter? whereas the array has 5 elements.
it would not compile because `int[6]` and `int[5]` are not compatible types
Plz make a video on DMA
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?
woow sir thanks
Superb
thank you
thx but how to call the second value ?? withoud adding ++ i mean *p[1]
without you I wont graduate
why can we just leave out the & and write int*p=a instead of int*=&a or int*p=&a[0]
Can pointer be stored in array if yes please give me syntax
First 57 seconds better at explaining that most other videos lol
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??
&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.
@@krishnachaitanyareddygujju2823 Makes sense
@@krishnachaitanyareddygujju2823 very well explained
Sir notes plzz
Nice
Suppose the length of array contains 10 elements.is it possible to point a pointer only 5 elements in those array??
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!)
@@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
Hi there, what will happen for these statements?
int arr[5] = { 1, 2, 3, 4, 5 };
int *ptr = arr;
for(int i=0; i
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
what if i want to print second element of array
*(*p + 1)
So "a" is equal to a pointer to an integer because "*(&a)" is the same as "a" right?
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
Think outside of the box 🤣
Who r the dislikers ? 🖕
Ssalute
:)
This is crazy lol
what
:-)
:)