Initially p has address of a[2]... And p=p+2 means two shift towards right from initial address.. So now.. P will have a[4].
@mdghufranalam73692 жыл бұрын
and uh also write as P will have 4[a].
@modapothularajasekhar46452 жыл бұрын
[4]
@youmemeyou Жыл бұрын
@@modapothularajasekhar4645&[øk]
@TantawyAhmad5 жыл бұрын
WOW!! Literally, best programming intro and C explanation I've seen so far the series is Amazing!! ❤ and the explanation is very simple😊 Please post daily content👌 I came here for the "Data Structure intro" but found the explanation worth to review the basics of programming all over again. I'm sure the other playlists are as good as this one. Thank you so much!!😊 Please post from the Data Structure part on your road map 🙏 >>Data Structures: 1) Stacks 2) Queues 3) Linked list 4) Trees 5) Binary search trees 6) Binary heaps 7) Graphs 8) Tree traversals
@tlarson911193 жыл бұрын
0:50 A shorter way would be to just get rid of the ampersand and [0]. When an array name is used in an expression, the array is automatically cast to a pointer to the first element of the array. So one could also write: int *p = a;
@simonmarabi26613 жыл бұрын
exactly
@hetaeramancer3 жыл бұрын
he's teaching it systematically. mentioning that shortcut will cause confusion to beginners
@techmad82043 жыл бұрын
Yes, isn't this the reason why we don't use & in scanf for strings?
@gyanusingh94162 жыл бұрын
@@techmad8204 yeah man
@sahil13072 жыл бұрын
@@techmad8204can you tell me which resources are you using to learn c
@abdelrahmanm.62154 жыл бұрын
Your videos have honestly made a HUGE difference in my academic career. i thank you from the bottom of my heart for putting in the effort and time.
This is the most amazing C tutorial. ❤️ Very good job, I can't wait for the playlist to be finished.
@seunlivefootball4 жыл бұрын
Wish i could see you and give you a hug, like right now! I have been trying to understand this pointer of a thing for more that three days, but here comes NESO ACADEMY which such a lucid explanation. Thank you very much! You've made my day.
@labandaetoilista48734 жыл бұрын
The answer is : the pointer will point to : a[4]
@bhargavskulkarni2855 Жыл бұрын
How
@bbom9197 Жыл бұрын
@@bhargavskulkarni2855it moves the pointer 2 index forward. Thats the fifth index Which we write a[4] Because counting begins from 0
@pascalchinedu67052 жыл бұрын
This series has made me attempt C programs I found difficult. I can't thank you enough sir. Better late than never. I'm glad I saw this academy
@080_cse_sanjaykarthicks43 жыл бұрын
Initially I thought that the pointer concept is very complex. But after watching videos of NESO academy about the pointers,I have started to understand the concept. Thanks for the instructor for making me understand the complex concept in an efficient way.
@sunilkumarreddy65375 жыл бұрын
It is realy a good explination for me apart from the class and coaching section. Thank you sir
@Neha-zm7by2 жыл бұрын
I never commented on anyone youtube channel but neso how can i thank you i am understanding everything(apart from recursion) and now i think i can pass my exam
@nisha..sharma..85543 жыл бұрын
I have taken course on udemy in c programming.. but after some days I have seen this channel on KZbin .. and I have a thought about wasting my money on udemy... ❤️❤️❤️... Thank u so much sir..
@nirbhayparmar4 жыл бұрын
a[4], 5th element of the array
@shiranabbasi3044 Жыл бұрын
No need to multiply by 4 in case of int array. See this example int size = 4; int arr[] = {1, 2, 3, 4}; int* p = &arr; *(p + 1) = 9; for (int i = 0; i < size; i++) { printf("%d ", arr[i]); } It should print: 1 9 3 4
@ramarajujaya24803 жыл бұрын
i can't express my happiness to find a great lecturer like u i am veryveryvery very happpy
@OshiniVidharaJayaweera3 ай бұрын
Thank you so much for these amazing videos. I understood really well what are pointers and literally I understand each point you explain. The best teacher ever for programming. Whoever I meet with doubts in C I will recommend Neso academy for sure
@raghavattri94493 жыл бұрын
I tried various platforms to learn c but the quality of explanation that u give is next level
@studyspectra_19803 жыл бұрын
And is a[4]..as p=p+2 simply means shifting the pointer by 2 units from the initial position in forward direction..ie.from a[2] to a[4]..
@yasharora43004 жыл бұрын
Thank you so much sir. Best explanation on complete KZbin.
@badavathjaipal70272 жыл бұрын
primary address is p is array of 3rd element i.e p=&a[2],when we add p=p+2 then new address i.e p=&a[2+2]=&a[4].which refer 5th element.
@rajivkumawat79402 жыл бұрын
ans is 4. sir i am 1st year student in iiit gwalior in IT stream. my programming language was going extremly wrost but neso academy saved my engineering life .i saw many youtube channel related to programming language but this one is extremly good. i gain more dept interest in programming because of you. so thank you very much sir for creating such kind of channel which helps all students . 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏thank you very much sir 🙏🙏🙏🙏🙏🙏
@ashwanikumarsrivastava11874 жыл бұрын
You are the best teacher for C programming
@niteshsoni89563 жыл бұрын
ANS- index will be 4....Sir thank you so much for teaching and sharing such amazing knowledge of C with us!!
@seshanky9 ай бұрын
Brother am sry but can u pls say what is an index 😅
@EigenA3 жыл бұрын
Taking care of me in signals, controls, and now during an internship. Great work!
@tinkukumarsiddharth22813 жыл бұрын
I didn't understand the any programming language in the,but here I am learning it with the interest.
@mohamedmezid4821 Жыл бұрын
Answer of the question: After the operation "p = p + 2", the pointer p will now point to the memory address that is 2 elements ahead of its current location. Since the initial value of p is the address of the 3rd element of the array i.e &a[2], after the operation p = p + 2, the pointer p will point to the 5th element of the array i.e p = &a[4]. Therefore, the index of the array after this operation is 4.
@adnaneafifi47343 жыл бұрын
If we want a[2+2] a[4] we have to multiply p=p+2*4 if we assume that the data stored is an integer.... and if we assume that the value of the integer a[2] is in 1002 to go to a[4] we have to add 4 and add 4 again 2*4
@asmiachiproduction2 жыл бұрын
If only if this video exists back in 2017, I would have excelled my programming paper. Thanks for the great content.
@abbikgg3992 Жыл бұрын
@jw72jswu728uwj You don't know his circumstances. Maybe he dropped and coming back at it again. Mind your own business.
@preetimadas35173 жыл бұрын
It will be a[4].... And sir you are amazing..... I m literally getting to understand C learning from u....
@priyankarodda19434 жыл бұрын
Excellent Teaching I get clear about pointers 👏👏👏👏👏👏👏
@sudipsen36774 жыл бұрын
Nice explanation sir ❤️ really amazing .Thank You
@creatorsayanb3 жыл бұрын
I'm looking that so many comments are a[4]. But p=&a[2] which means the base value of a[2]. When we write p=p+2, then base value will added with 2. and the output of p will be a base value only. Not a value like a[3],a[4] etc.
@samrudhshetty93346 ай бұрын
your totally correct bro. my brain was rotting reading the comment sectiom
@ajmalkhaniit4 жыл бұрын
Index will be 5 bz pointer contains third address of array and we 2 in this so pointer will move 2 position in forward direction
@EyeNeo3 жыл бұрын
Index will be the p[4] which is actually the fifth element of the array.
@TEeducation4 жыл бұрын
'P' will point the &a[4] of the array, that means i will point he 5th element of thee array.
@emperorisalive6 ай бұрын
The video explains pointer arithmetic, specifically how adding an integer to a pointer moves the pointer forward by that many positions in the array. It provides examples and explains the underlying memory layout. Key moments: 00:00 Understanding pointer arithmetic is crucial in programming. Adding an integer to a pointer moves it to the next memory location, not just by the integer value, due to memory allocation. -Pointer arithmetic involves moving pointers to different memory locations based on integer additions. -Explaining the concept of adding an integer to a pointer using a practical example with array indexing. -Detailing the memory allocation and the impact of adding an integer to a pointer on memory addresses.
@080_cse_sanjaykarthicks43 жыл бұрын
The answer to the h.w qn is 4 as first the pointer pointed to the index 2 and p=p+2 moves 2 positions to the right, and so now the pointer will point to index 4,i.e,p=&a[4]
@nawalazhar4 жыл бұрын
please add more topics! i love your explanation style!!
@otetumooluwaseun39484 ай бұрын
As p contains the address location of a[2] p + 2 will be a[4] ie the fourth index of a
@ankitaverma22715 жыл бұрын
So the index of the array after this operation is p=a[4]. Sir please let us know whether it js the right answer or not?
@QuotationNation3 жыл бұрын
right
@Tanzimhossain2 Жыл бұрын
6:38 a[2+2]= a[4]
@wastetanz3 жыл бұрын
this was so clear! thank you for this
@adityathakur8951 Жыл бұрын
Abee
@tamimurrahman6193 жыл бұрын
p=&a[2]------->address of array 1008--------->elements position is 3rd in array; =>p=p+2=p+2*4=1008+8=1016; -------->which location is address of array a[4](1016)---->elements position is 5th in array.....
@raktimmandal24764 жыл бұрын
Initially p has address of a[2]. And "p=p+2" means two shift forward from initial address. So now - P will have a[4]. because 2+2=4.
@achugh52Ай бұрын
pointer p will have address of p[4] hence point to p[4].
@himanshuranjan6574 жыл бұрын
The explanation is like butter
@AshishKumar-rb1gw2 жыл бұрын
Programming language is very good and practice with me and improve skills thinku you so much your practice white
@SarthSanjayJoshiBEE Жыл бұрын
The index of the array pointed by the pointer p will be a[4]
@shreyasingh2223 жыл бұрын
Thanks for such great explanation ....
@twiz88592 жыл бұрын
Century complete now second century on. Can we say 6:00 p+3*4=Base address+next Element*total byte of that element.
@shaireenwaheed64923 жыл бұрын
Sir ans is Base add a[0]+2*4 And Index 2
@RAVIVERMA-zy3vs4 жыл бұрын
Lets consider the base address is 1000 and currently the pointer is at 3rd element which means 1000+4+4=1008 is equal to & a[2] and we have to add 2 to it p=p+2 means 1008+2*4=1016 Which is nothing but & a[4] so this is the Answer...
@vaibhavsharma92982 жыл бұрын
Amazing video 🙆♂️
@shivamrawat42894 жыл бұрын
HOMEWORK QUESTION we will get index 4 i.e.a[4] --(EXPLANATION)------->>>>>suppose we take &a[2]=1000, so according to question (p) is equal to 1000 and if we perform p=p+2*4 as earlier explained in the current video , we will get p=1008 and each element of array ocupy 4 bytes of memory , so definetly after reaching from address 1000 to 1008 we have moved two index value forward means from a[2] to a[4], means from index 2 to index 4. So final ans is we have reached a[4]. hope you all understand :) .
@devsutong4 жыл бұрын
why did the instructor says that we should multiply by 2 by 4 in 5:40
@shivamrawat42894 жыл бұрын
@@devsutong bro simply we can say it is the formula to perform such things and practically if we do this question on compiler same output we get so we can say that we have understood which formula compiler use to perform such functions .
@devsutong4 жыл бұрын
@@shivamrawat4289 ok now i understand, good explanation by the instructor but his English is very misleading
@nizammalik21483 жыл бұрын
Amazing explanation.
@Perceptionz_Sound2 жыл бұрын
Great video.
@D-Coder440 Жыл бұрын
Thank You Soo Much
@ashishkumarpal3805 жыл бұрын
Initially p have &a [2] and after p=p+2 address will be shift two index right so ans is &a [4]
@tejparmar34405 жыл бұрын
Initial index value of p=2 and after adding 2 it will become p=4
@venkateshpulukuri48323 жыл бұрын
in writing of address ,p=p+1*size of the data type ;is better i thought
@jakemichaelwilson2 жыл бұрын
Thanks again for the videos. At 5:05 I'm confused why the video shows p=p+1 when the correct way is p=1000+1x4? Is the prior the way how it should be written in C? I already watched the following video as well. It would clear things up if I understood why it is important to understand both math concepts? Which one is the code format for C?
@clashbegins20632 жыл бұрын
its only p+1 not p+1*data type
@maxcanten2922 Жыл бұрын
P points to the array a[4] And index will be 5
@tayyab.sheikh10 ай бұрын
H.W problem : p = &a[2] ; p = &a[2] + 2 ; ❌ p = &a[2 + 2] = &a[4] ; ✔️
@mokkalapradeep72905 жыл бұрын
please make a videos in sorting techniques and some more programs on patterns it is important they test us logical knowledge
@MuhammadAbdullah-wx1ev Жыл бұрын
here a[2] means third element so p+2 wil shift the pointer to the fifth element so the final answer will be p=&a[[4]
@engineer78573 жыл бұрын
Thank you for this wonderful job. 😀
@nehajaiswal39424 жыл бұрын
Best explanation ever
@48_subhambanerjee222 жыл бұрын
answer to homework question: it will point to a[4].. that means, 5th element in the array
@HopeNHopes18 сағат бұрын
The answer is a[4] that is the fifth element of the array;//
@KumarRavi_253 жыл бұрын
You are Doing a great work❤️❤️
@manavbabber54544 жыл бұрын
Please upload the videos of data structure topics including stacks,queues,heaps,linked lists etc
@HinaFirdaus5 жыл бұрын
4th index or 5th element 4B base address then 1016
@techys43353 жыл бұрын
pointer will point index 4 i,e 5th element of an array
@nuralyazafira19603 жыл бұрын
answer p will point to the fourth elements so p=&a[4]
@aatmprakash4 жыл бұрын
please make video on MICROPROCCESSOR 👍👍👍
@anandharsh17733 жыл бұрын
thanku sir ur great .........
@TheRedTeam5 жыл бұрын
Fried my brain. Good night.
@jeedikantivenkat78145 жыл бұрын
Index of array will be 5 Pointer will point to a[4]
@andiespeg18973 жыл бұрын
Is element and index the same... If not... It will point to element 5... Index 4...
@CheapPhysics2 жыл бұрын
The index is 4.. And the memory location is 1016.... (Say 0 index has 1000 memory location)
@priyaupwanshi80633 жыл бұрын
Index = a[4] after p = p + 2
@zainabbohra29153 жыл бұрын
Amazing sir😎
@true41894 жыл бұрын
Thank u
@castiel05043 жыл бұрын
I think the answer is p=[a4]...Because pointer shifts 2 places in the right direction.
@akhil99673 жыл бұрын
If initial address is 1000 then 1016 is the location that pointer points to.
@mouneshdb92113 жыл бұрын
a[4] or 5th element of array
@rashmisharma93974 жыл бұрын
P=p+2 as you earlier said that we have to multiple the memory byte the int is taking so why we are not multiplying 4 to 2
@java_shaileshkushwaha8784 жыл бұрын
Because p=p+2 is also equivalent to p=p+2*4 but here i do explicitly but compiler do implicit Internally compiler do same as your thought but we not use this type calculation it is time consume working same
@pranavhendre6209 Жыл бұрын
the answer :-a[4];
@negativedignity89943 жыл бұрын
saying p = &a[2] and after the operation p = p + 2 the answer will be p = &a[2 + 2] === p = &a[4]
@kunaii_cs4 жыл бұрын
Its the fifth elemnt or p=&a[4]
@myviews89914 жыл бұрын
Index of the array remains same as we are incrementing the address in the pointer by 2 but index of the array was never changed......
@DeepakKumar-fd4qu5 жыл бұрын
Sir please make a video on structure and union as soon as possible please huge request to you
@sr-sunny-raj4 жыл бұрын
index after operation will be -: 4.
@compangit1524 Жыл бұрын
The index will be at the 5th elements of the array.
@raghavan85944 жыл бұрын
Sir,what if, initially when 'p' points to final element??
@akshitarora4704 жыл бұрын
You will be able to view the address next in line (4 bytes separated) , but obviously doing a *p for that memory location will result in an error.
@sandraokafor53803 жыл бұрын
The answer is a[4]. I love these videos a lot, they are quite explanatory. Thank you.