Pointer Pointing to an Entire Array

  Рет қаралды 204,996

Neso Academy

Neso Academy

Күн бұрын

C Programming: Pointer Pointing to an Entire Array in C Programming.
Topic discussed:
1) A pointer pointing to the whole array instead of pointing to the first element of the array.
C Programming Lectures: goo.gl/7Eh2SS
Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
Contribute: www.nesoacademy...
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy...
Website ► www.nesoacademy...
Forum ► forum.nesoacade...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#CProgrammingByNeso #CProgramming #Pointers #PointersInC

Пікірлер: 104
@DrOggy67
@DrOggy67 3 жыл бұрын
This is maybe the most important lecture of the whole C course... Thanks a lot for this great explanation!
@hetaeramancer
@hetaeramancer 3 жыл бұрын
no, most important is the fiorst couple of videos
@Dalia2Lily
@Dalia2Lily 3 жыл бұрын
NESO Academy, I can't stop loving you guys
@motivationmastery2327
@motivationmastery2327 3 жыл бұрын
Noone could have ever taught this as much as clear as you did!Salaam Rocky bhai!!! Love you 3000!
@sayaknandi139
@sayaknandi139 2 жыл бұрын
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
@axolet
@axolet 3 жыл бұрын
Roses are red Violets are blue Neso's the best tutor for you
@pradhanan9413
@pradhanan9413 3 жыл бұрын
Doesn't rhyme but its true❤️
@prototype18
@prototype18 3 жыл бұрын
You guys are seriously doing a good job Thank you Neso Academy!!! Keep up the good work!!!
@azubuikedanielezeadim4019
@azubuikedanielezeadim4019 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
@SerhatAtes
@SerhatAtes 3 жыл бұрын
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);
@Trading_Club007
@Trading_Club007 Жыл бұрын
yes its correct whats the problem
@yesvee7377
@yesvee7377 3 жыл бұрын
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
@janardhanreddyboyalla2941
@janardhanreddyboyalla2941 3 жыл бұрын
Very Useful For Us Sir. Keep going like this sir. Thank You
@yashjaiswal83
@yashjaiswal83 4 жыл бұрын
thank you neso you cleared my doubt very very well!!
@saurabhtiwari287
@saurabhtiwari287 3 жыл бұрын
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. 😇😇😇
@khoileminh5710
@khoileminh5710 3 жыл бұрын
Your visual explanation is so helpful, keep it up!
@sdk28
@sdk28 3 жыл бұрын
Pointer is the thing which can get you high. It's really strong!
@vimalathithand917
@vimalathithand917 Жыл бұрын
Such a wonderful video! Thanks a lot for providing such a quality content free of cost
@ss24567nsingh
@ss24567nsingh Жыл бұрын
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.
@Ertyuiigff-sq5fi
@Ertyuiigff-sq5fi 3 жыл бұрын
what a superb explanation i love it
@santasingh9045
@santasingh9045 3 жыл бұрын
Great Explanation
@mohammadsayem2257
@mohammadsayem2257 3 жыл бұрын
Great explanation...
@hetanhawke1695
@hetanhawke1695 5 жыл бұрын
u r the best
@khushiyadav6138
@khushiyadav6138 3 жыл бұрын
Thanks for uploading such a nice video 🙂. Explained beautifully ❤️
@dakalasomasekhar6426
@dakalasomasekhar6426 5 жыл бұрын
good explanation and thank you🤝
@shubhamrahinj6864
@shubhamrahinj6864 Жыл бұрын
These c series is simply exceptional & mind blowing
@xiangli9588
@xiangli9588 3 жыл бұрын
Thank you. This helped me understand arrays.
@abhishekm1903
@abhishekm1903 3 жыл бұрын
Excellent Work
@shivampatel8850
@shivampatel8850 2 жыл бұрын
I like your explanation and please never not stop making such videos
@shiksharawat6948
@shiksharawat6948 Жыл бұрын
Thank u so muchh you don't know how much you helped me at this confusing concept 😢❤lots of love
@bhawnasingh926
@bhawnasingh926 4 жыл бұрын
Finally got it !!!!!......Thanks
@mehulshah9027
@mehulshah9027 3 жыл бұрын
how to print other elements ???
@SerhatAtes
@SerhatAtes 3 жыл бұрын
*(*p + 1) -> print the second element of the given array
@pradhanan9413
@pradhanan9413 3 жыл бұрын
@@SerhatAtes correct
@stevewilsonraj
@stevewilsonraj 3 жыл бұрын
the best explanation !
@harie8035
@harie8035 2 жыл бұрын
Thank you from the core
@asmakhan541
@asmakhan541 4 жыл бұрын
ThAnk u thanku thank u thank u sirrrrrr thousands time thank u from pak
@anrukshrajput
@anrukshrajput Жыл бұрын
The video was interesting and easy to understand, I want to know how to get access to second and third element of array directly.
@sujaymallick2202
@sujaymallick2202 2 жыл бұрын
Elaboration is really lucid !
@funnyanimation888
@funnyanimation888 2 жыл бұрын
This s real education
@mhj.xd7
@mhj.xd7 Жыл бұрын
short and clear
@harmankaur3938
@harmankaur3938 2 жыл бұрын
because of you guys i got addicted with C❤️
@What_I_Make
@What_I_Make 5 жыл бұрын
Good understanding regarding the zones, now all I need to do is understand why do it.
@manthanparekh6490
@manthanparekh6490 8 ай бұрын
Please also explain for 2D array
@ganeshraj541
@ganeshraj541 2 жыл бұрын
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?
@tayyab.sheikh
@tayyab.sheikh 9 ай бұрын
Amazing ❤
@mohankrishna2875
@mohankrishna2875 2 жыл бұрын
Very nice explanation sir 🙂
@Aabara_ka_dabara
@Aabara_ka_dabara Жыл бұрын
informative lecture....
@prajnasuresh2876
@prajnasuresh2876 3 жыл бұрын
*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!!
@compilerrun5516
@compilerrun5516 4 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
@@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.
@anjalirajeev1054
@anjalirajeev1054 3 жыл бұрын
Thank u 💯💯💯💯
@JKA-sf7ll
@JKA-sf7ll 3 жыл бұрын
&a is address of entire array a is address of 1st element of array
@aladdinxd3902
@aladdinxd3902 3 жыл бұрын
3 din se dimag ghumgaya❤️
@lakshanchamod1208
@lakshanchamod1208 Жыл бұрын
woow sir thanks
@shreyasingh222
@shreyasingh222 3 жыл бұрын
thanks for this useful video.....
@user-vp2mf2pw1m
@user-vp2mf2pw1m 7 ай бұрын
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?
@MohamedMagdy-pt5zo
@MohamedMagdy-pt5zo 4 жыл бұрын
Thx for your help
@akshaycharjan6384
@akshaycharjan6384 3 жыл бұрын
Thank You Sir :)
@satyamsharma5181
@satyamsharma5181 4 жыл бұрын
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
@abdullahrahad3584
@abdullahrahad3584 4 жыл бұрын
hello bro have you solve your problem?
@crazyboy-gw7rk
@crazyboy-gw7rk 4 жыл бұрын
Same
@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?
@tejastej2762
@tejastej2762 3 жыл бұрын
Superb
@qandos-nour
@qandos-nour 4 жыл бұрын
thank you
@indian3451
@indian3451 5 жыл бұрын
Plz make a video on DMA
@animeshsrivastava5067
@animeshsrivastava5067 Ай бұрын
int (*p)[5] = a; should be done , instead of using &a
@adityasaxena6619
@adityasaxena6619 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 жыл бұрын
&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
@hetaeramancer
@hetaeramancer 2 жыл бұрын
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
@ase6817
@ase6817 5 ай бұрын
why can we just leave out the & and write int*p=a instead of int*=&a or int*p=&a[0]
@nileshpokale862
@nileshpokale862 3 жыл бұрын
Enemy down. All cleared.
@adityaraje7015
@adityaraje7015 2 жыл бұрын
Can pointer be stored in array if yes please give me syntax
@mca_waala
@mca_waala Жыл бұрын
Nice
@EverythingTechWithMustafa
@EverythingTechWithMustafa 4 жыл бұрын
Sir notes plzz
@devToumeh
@devToumeh 3 жыл бұрын
thx but how to call the second value ?? withoud adding ++ i mean *p[1]
@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
@user-vn9ld2ce1s
@user-vn9ld2ce1s 2 жыл бұрын
Well, someone should've told us this a long time ago...
@adolfocarrillo248
@adolfocarrillo248 4 жыл бұрын
So "a" is equal to a pointer to an integer because "*(&a)" is the same as "a" right?
@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 жыл бұрын
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
@kells137
@kells137 Жыл бұрын
without you I wont graduate
@syedyousufhussain2725
@syedyousufhussain2725 3 жыл бұрын
what if i want to print second element of array
@SerhatAtes
@SerhatAtes 3 жыл бұрын
*(*p + 1)
@nickolaisimmons4638
@nickolaisimmons4638 3 жыл бұрын
First 57 seconds better at explaining that most other videos lol
@Hiyori___
@Hiyori___ 3 жыл бұрын
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
@DaiMoscv
@DaiMoscv 2 жыл бұрын
Think outside of the box 🤣
@dineshchintu9779
@dineshchintu9779 3 жыл бұрын
:)
@andistheinforitbutso7513
@andistheinforitbutso7513 2 жыл бұрын
Ssalute
@shampabhattacharya5125
@shampabhattacharya5125 4 жыл бұрын
Who r the dislikers ? 🖕
@rede_neural
@rede_neural 2 жыл бұрын
This is crazy lol
@sashah1454
@sashah1454 2 жыл бұрын
what
@vigneshsvicky2110
@vigneshsvicky2110 3 жыл бұрын
:-)
@mehulgour5417
@mehulgour5417 3 жыл бұрын
:)
Pointer Pointing to an Entire Array (Solved Problem)
6:20
Neso Academy
Рет қаралды 100 М.
Using Array Name as a Pointer
6:54
Neso Academy
Рет қаралды 164 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 153 МЛН
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 935 М.
Alat yang Membersihkan Kaki dalam Hitungan Detik 🦶🫧
00:24
Poly Holy Yow Indonesia
Рет қаралды 11 МЛН
Structure Padding in C
8:42
Neso Academy
Рет қаралды 239 М.
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 69 М.
Function Pointers in C
6:07
Neso Academy
Рет қаралды 257 М.
Pointers (Important Questions)
11:11
Neso Academy
Рет қаралды 340 М.
Pointers (Program 3)
10:55
Neso Academy
Рет қаралды 102 М.
Value of Operator in Pointers
5:44
Neso Academy
Рет қаралды 356 М.
String Comparison Function - strcmp()
6:04
Neso Academy
Рет қаралды 133 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 153 МЛН