Pointers and 2-D arrays

preview_player
Показать описание
See complete series on pointers here:

In this lesson, we will see how we can work with 2-D (two dimensional) arrays using pointers. We have explained how 2-D arrays are organized in memory and how pointer arithmetic and dereferencing can be used to work with 2-D arrays.

For more such videos and updates, you may subscribe to our channel.

Рекомендации по теме
Комментарии
Автор

Indians came from another planet, thank you very much for the awesome explanation. Greetings from Italy!

Phoenix
Автор

After about 12 straight hours of scratching my head with pointer exercises, all the answers I needed were in this video. Eternally grateful to you!

lautarodelucia
Автор

I have done a lot of online courses included Strang's (MIT) Linear Algebra, Khan Academy, and Noam Nissan's Nand2Tetris. Not sure of the instructors name, but mycondeschool teaches with the same clarity and intuition of these other great instructors.

jeffflammer
Автор

Had to watch the video 3 times! :) Hopefully I can explain this correctly. At 4:30 in the video, pay attention. If B were a 1d array, then B[0]=200. Then, using * to dereference gives you '2'. If however, B is a 2d array, then once again B[0] = 200 BUT of a 2d array which means when you dereference with *, you are still at 200 but, now in a 1d array! Confused? Watch it over and over like I did. In other words, to print '2' when B is a 2d array, , use **B. This was fouling me up. Got it now. Thank you.

michaelpatterson
Автор

*_i really loved this video. This video was so conceptual i have seen lots of C video playlists on youtube but none of the video covered such details. I really admire the effort you made and you are really good programmer :) hope i get to learn java from you_*

AbhimanyuAryan
Автор

You NAILED it! This is the BEST class of Pointers and 2-D arrasys I've ever seen. FOR GOOD. Thank you so much!!

ulysses_grant
Автор

I can’t believe you describe such a complex concepts in this way. Good channel, i will see you a lots

huysaysoui
Автор

This was the best tutorial video on pointers for multi-dimentional array that I have ever watched. Thank you so much for making such tutorial videos, it helps us a lot. Thankyou very much

bukubukuchakama
Автор

This is the best explanation that I have seen so far for this topic. You are really amazing !!

shashankkhemka
Автор

Thanks for watching. I mean why?
.
.
.
THANKS FOR MAKING bruh

KishanKumar-mzxr
Автор

omg I love you sir 😂❤
I've been looking for this explaination for literally months and never understood how to handle 2D arrays with pointers untill I saw this video
thank you so much for making this video ❤❤

famen
Автор

It helped me to think about these examples by using the word adress. Also, that part in the begining of the video it is shown that in 1D array B[1] == *(B+1) and
&B[1] == B+1. It helped me to think about multi dimensional arrays as things, where the previous two rules apply. Also, keep in mind that if you have a 2D array like in this video B[2][3], if you write B[0] that is a 1D array (1D array which has 3 elements in it). Which means that B[0] is a memory adress. These three insights (or four depending on how you count them) were what made me understand this. Hope this helps to someone struggling to understand this. If you don't get it immediately, watch the video again, think about it and you will understand it.

Schannel
Автор

good job!!!! you know i can't understand C pointer and some other things about data structures and algorithms, before watching these videos ! you are the best ! thank you so much ! ---you fans from China

jinyunsiwu
Автор

Usually hate scouring for coding videos on youtube cause they all suck, but this video really helped! Came into this with a lot of scepticism, but was shocked with how he dumbed everything down to make it understandable (unlike my prof). Thanks for making this video bro, cleared up alot of questions.

ianchandra
Автор

Explained really beautifully! Thanks for allocating your time for creating this series of lectures.

SuperTurkce
Автор

superb video series, none I have seen that clears concepts in pointers this deep and lucidly.

shivagameon
Автор

Please watch the video "Pointers and arrays" in this series. It will help you understand the concept.

mycodeschool
Автор

To all those who have a doubt that at why 8:29, (B+1) and *(B+1) both are equal to 412, here is the answer.

B+1 gives the address of a pointer which is pointing to a 1-D array of size 3. The type of the pointer is such that it points to a 1-D array and in this particular case it is pointing to the 2nd element of the 2-D array, that is, row B[1]. So when you do pointer arithmetic, it will increment or decrement with the size of a 1-D array of size 3. For example, B+2 will give the address of a pointer of the next row in the 2-D matrix, that is, address of B[2].

On the other hand, *(B+1) is a type of an integer pointer which points to the first element of the 1-D array. This is an integer pointer and arithmetic on this would result in increment and decrement with the size of an integer, that is, 4 bytes. Hence *(B+1) +1 would give the address of the next integer!

raunakmaheshwari
Автор

The B[0] = &B[0][0] part in this video is so good that it helped me click something I didn't understand all semester. Thanks for the video!

gianniskurgiakis
Автор

i can not find someone bettr than you in anything you explain ... you are awesome ...keep up the good work ..thanks

waleedosama