I know you'll never see this, but I just wanted to say that no amount of "thank you's" from me will ever be enough to convey the gratitude I have for your tutorials nor will they ever equal what you've done for us through your concise teaching.
@apoorvdixit28564 жыл бұрын
why *B do not give value but address. please help
@AdarshKumar-mf3ls4 жыл бұрын
@@apoorvdixit2856 *B will return pointer to integer because it is multidimensional array. To get value you can again dereference it using **B.
@JJ-nv6nl4 жыл бұрын
@@AdarshKumar-mf3ls but why don't we use & for that adress instead of *?
@AdarshKumar-mf3ls4 жыл бұрын
@@JJ-nv6nl & gives the address of memory of the first element of array. But in array we can also get address of array by the array name . Pointer * is used to dereference (means to get data of array) .
@JJ-nv6nl4 жыл бұрын
@@AdarshKumar-mf3ls thank you for answer, but what I don't understand is this: in 1-D array (let it name B) when we want adress of a first element we use &B and for value *B. But in 2-D array when we use *B we get adress of first element instead of value(like in 1-D array). Can you explain me why please?
@zmatt89010 жыл бұрын
Your videos are very clear and informative, more-so than any other written article or video I've looked at regarding this subject specifically. Much appreciated !
@sagivalia50413 жыл бұрын
I was lucky enough to stumble in his videos through Free Code Camp. This guy is one of a kind, he manages to both explain a notoriously tricky subject in a simple way THAT is also understandable. I truly hope he is doing good in life, he deserves it. Regarding the passing of multi-dimensional arrays in functions, it seems abit hard-coded that you need to specify the dimensions of the array and can't do it truly flexible.
@anushkanayak37557 жыл бұрын
Your voice is just awesome...and so is your way of explaining
@sushmitanigam49799 жыл бұрын
i dont have words to appreciate your lectures. I was so confused about the 2 dimensional array and pointer thing. I even read Dennis Ritchie book but all of them failed to clear my doubts when finally i saw ur videos and i got enlightened with such a tremendous knowledge.. Thanku sir..u r just awesome
@adityadonepudi8856 жыл бұрын
Sir, no one can explain pointers in a better way than you did. I literally pray you sir. Please please keep more videos on the basics of programming. How stuff works in memory etc etc. I think many would lack the same. But knowing it would definitely make one a rather more beautiful programmer
@ozzyfromspace5 жыл бұрын
For some reason this was kinda hard for me, but after watching this video (and the one before it) 7 billion times, I think I get it. Thank you!
@TEXAS24599 жыл бұрын
well i cant believe that i have reached to this 11thh lesson of pointers by his book.......i hated pointers so much that it is unbelievable for me to even imagine digging deep in the concept....Thanks to mycodeschool his explain of things are awesome and simple.
@kurtne48926 жыл бұрын
That topic is not that deep. Its just not obvious, in conclusion its really good to get an explanation
@mohanaddarwish23079 жыл бұрын
i am so happy :D "I am good working with multi-dimensional arrays using pointers"
@andrewchan83029 жыл бұрын
Truly amazing, I never used to get pointers, it has always baffled me. But now I have a good understanding of it. Thank you so much :D. Hopefully I can manipulate pointers better now.
@akshdeeprajawat96425 жыл бұрын
Ohh Balle Balle I understand Pointers now . So Happy !!!!!!!!!!!!! Thank you !!!!!!!!!!
@devendramishra41976 жыл бұрын
You are Awesome ..Electronics engineer ...like to understand the things deeply how it works ..You are the only i got on utube with such a nice explaination..thanx brother its really helpful..
@simranseetha61913 жыл бұрын
amazing , after my 4 years of engineering now i am getting this concept in just a 14 min video , thanks alot
@sajithnandasena4 жыл бұрын
Finally, I found who you are. Thanks for your great lectures.
@aswin2pranav8 жыл бұрын
Beautiful.. simply cannot make it simpler or cleared... there is so much detail backed into these videos.
@jenishkubavat79764 жыл бұрын
you make me fall in love with pointers
@ahmed_raaphat Жыл бұрын
This one is a bit mind-blowing. However, the explanation would have never been better than that. So clear and awesome!
@thekylesmithexperience Жыл бұрын
This was helpful. Thank-you for creating this content on C++ pointers and 2D arrays!
@sarmadkamran582 жыл бұрын
The way you've represented this pointer Playlist, it's hard to believe this was uploaded 8 years ago.
@VijayRaavi5 жыл бұрын
This series is super clutch, thank you so much.
@bigmak84511 жыл бұрын
Very clear. You are an excellent teacher. Thanks!
@giocarro69357 жыл бұрын
Simplemente lo ame!!! nunca había visto alguien que explicará tan bien los punteros!!! ¡Muchas Gracias! ¡Vi todos los videos! je, je
@rittenbrake16134 жыл бұрын
This is SUPER Clear !!!! Thousands Thanks !!!
@rahmatabadi38395 жыл бұрын
16:21 You are not 100% correct here. We can use void Func(int** A) for processing int B[2][3] but via auxiliary steps: int* p[] = {B[0],B[1]}; and int** pp =p;. So we pass Func(pp);
@ManishKumar-gb7yf5 жыл бұрын
Thanks for these awesome tutorials. Just one thing, I have tried assigning B directly to an integer pointer without using the parenthesis with the pointer variable and it works fine, it does not produce any compilation error.
@ottolin71426 жыл бұрын
Can someone explain, why char** argv works? In the video it is said that int** A won't work. As far as I can say, the "3" in "A[ ][3]" is important to let the compiler know the size of the arrays. That way, pointer arithmetic will work. But how comes that "argv++" is a valid instruction (for example if you use getopt())?
@utcarshsrivastava66404 жыл бұрын
AT 13:01 , why does c& *c give same value. C is the pointer to the arrays, but *c is the pointer to the pointer to the arrays.
@ShopperPlug2 жыл бұрын
I can't believe c/c++ programming books does not show the multidimensional array used practically for function use, I never realized it could be so complex like this. Declaring multidimensional array is easy, making use out of them from functions is mind twisting.
@sushmitanigam49799 жыл бұрын
very valuable lesson for gate too..thanx sir..with ur help i am able to solve gate question of C
@Anonymous-mz9un3 жыл бұрын
Sad to hear your story sir. I know why you can't make videos any more. Still thanks for your existing videos. You guys were legendary to the whole programming community.
@ramzirich25853 жыл бұрын
why he stopped, hope nothing bad happened to him
@gigachadkartik3 жыл бұрын
@@ramzirich2585 His friend(also partner in this channel) died in car accident.
@meghasyam4277 жыл бұрын
man you are the best.....i have been watchin this playlist from the beginning and it has just been awesome.... please upload beginner classes on python , javascript etc..
@nishanttiwari30156 жыл бұрын
He cannot. Go google about this guy. The loss has been tremendously ours. :(
@Anonymous-mz9un3 жыл бұрын
@@nishanttiwari3015 No. It is his friend. He now works in google.
@hemanthkumar33717 жыл бұрын
thank u very much sir. your teaching skill is very good and easy to understand.sorry sir I missed to put like in most of these videos
@manishkumar-uv7rl6 жыл бұрын
sir , at print statement we have to use pointer "p" instead of using multidimension array name(*c replace with *p) i think..?
@Olavotemrazaodenovo4 жыл бұрын
Congratulations from Brazil.
@lasyagajavelli5946 жыл бұрын
Do more videos like dis sir...u really solved my all probs ..thank you sir 🤗
@HoldMyTeacup4 жыл бұрын
00:28 I love your echo :)
@JohnDoe-kj2cs3 жыл бұрын
Best explanation brotha !
@tejdeepreddy43072 жыл бұрын
Good teaching sir....Thank you
@brunoferreiradasilva93583 жыл бұрын
This is pure gold \o/
@tazanoukevin70086 жыл бұрын
the expression *(*(b+i)+j) gives different byte values each time its being compiled, how to verify if its true? 6:44 by the way , thanks for the videos,
@tazanoukevin70086 жыл бұрын
ah its okay, answered at 13:10
@vitang00710 жыл бұрын
I want to know, why cant we use **p for a 2D array and ***p for a 3D array. I think it should work...can you please give the technicality associated with this.?
@GurpreetKakar48737 жыл бұрын
***p will work. It will print the B[0][0][0].
@chandrabhattasriram94757 жыл бұрын
Whatever you've pointed out is true and it does work. Read about it, in this link :- stackoverflow.com/questions/8767166/passing-a-2d-array-to-a-c-function?noredirect=1&lq=1
@418_akshitasharma33 жыл бұрын
**p is actually a pointer to pointer. What we need to pass is an array containing pointers.
@ash_engineering6 жыл бұрын
superb explanation, Thank you so much
@chandrabhattasriram94757 жыл бұрын
Actually, if you think about it, a 2D array can be sent as a pointer to pointer in C/C++. If what you've said is true, then, "int main(int argc, char **argv)", would never work. Read this: stackoverflow.com/questions/8767166/passing-a-2d-array-to-a-c-function?noredirect=1&lq=1 Apart from that, I think your video is really great to understand the concepts of multidimensional arrays :)
@musabr.56856 жыл бұрын
only possible, when you have declared a pointer array. your argument related "int main(int argc, char **argv)" is totally wrong. or perhaps you can pass parameters it like (datatype * )arg .
@kautukraj5 жыл бұрын
Very helpful.
@codingunconditionally2 жыл бұрын
Amazing stuff, thank you so much! :)
@kiranbandagar25726 жыл бұрын
you are just awesome.....thanks a ton sir..
@Anoopegi9 жыл бұрын
very informative. i like your all videos. pls provide videos on oops in c++
@SahilJSawant6 жыл бұрын
in 1D array size had to passed separately. So for a 2D array do we need to pass the number of 1D arrays that are present in 2D array?
@umairalvi73825 жыл бұрын
These are not just simple words that he is speaking they are diamonds.
@ayushthakur7333 жыл бұрын
what if we do not know the size of the 2-D array, what should we write in argument to pass it
@indiann871 Жыл бұрын
Nice explanation
@sameerabegum62718 жыл бұрын
sir..can u please show the logic needed for multiplication of matrices with n without functions plz
@upmabaranwal56727 жыл бұрын
very clear xplanation sir
@yogeshwarpatel75406 жыл бұрын
great explanation ever, thank you very much sir
@bhavikp436 жыл бұрын
int a[5] = {2,4,5,8,1}; int *p; p= a; print a; //200 print *a; //2 sir ne pehle wale video me bola ki pointer name ke aage * lagane se dereference hota h n value return karta h. but is wale video me 4:00 sir bol rhe h ki *baddress print karega matlab output 400 aayega . koi explanation de payega? @mycodeschool
@musabr.56856 жыл бұрын
it is the 2-d array. so you need to add one more * to get the value. and it would be like **b which is equal to *b[0] or b[0][0] these are all same. *b = b[0] = &b[0][0] = b (period) will give you the same address
@kamalkannan54357 жыл бұрын
Is it possible to represent the 3dimensional array in a picture, if possible help me guys with clear explanations and some real time examples as well.
@oueslatinisrine80942 жыл бұрын
Thank you 🙂💯
@gazeguilty69166 жыл бұрын
really good explanation
@roshenw11 жыл бұрын
really good teaching.. Thank you !
@bineeshmathew646710 жыл бұрын
Sir your videos are very good. I have one doubt. I want to read a matrix from user and then pass it to a function. While writing code the dimension of that matrix will be unknown. Dimensions will be decided by the user. Let size is mXn. Can i use A[][n] to receive the matrix to the function.
@mycodeschool10 жыл бұрын
bineesh mathew Passing Multidimensional arrays as function argument in C/C++ is tricky. Watch these videos to understand this concept better. kzbin.info/www/bejne/qXnGn6mQdpeobpqcttps://kzbin.info/www/bejne/lZuYnZt-jNCVpLM
@bineeshmathew646710 жыл бұрын
mycodeschool in the discussion not mentioning about 2D array that read from a user. in that case size of column and row will be unknown. in such case how we can pass it?
@ravindersingh-cz9ir8 жыл бұрын
sir its not clear why *B returning 400 ? *B referencing to base address 400 so it should return 2 pls clear my doubt??
@mitzucelrau8 жыл бұрын
B - pointer to first in element inside B[n][m] *B - pointer to first element inside array B[0] If you want to get the value of element B[0][0], you should use *(*B)
@shadyahmed38307 жыл бұрын
can you give me a simple example?
@patrasculucian24036 жыл бұрын
Simple example: *B = 400 B = 400 *B + 1 = 404 B + 1 = 412
@amateurbeginner75387 жыл бұрын
please help :( why in 15:34 is false and in 15:48 is ok??
@md-ayaz8 жыл бұрын
Where can I find some practice questions on pointer arithmetic?
can u please explain me once how *(c[0][0]+1)) will gives output as 5
@tigerrr69 жыл бұрын
+Lokesh k hello, first of all, you need to understand that c[0] points to the first adress with the values (2,5)(7,9) witch both are arrays too, so if you look at c[0][0] you are getting a pointer to (2,5) the value 2 being on position 0 and the value 5 being on position 1, so when u have c[0][0][1] its pointing to the adress of 5, and because the expression is being dereferenced by the star, it returns the value contained on the c[0][0][1] adress .... hope it helped :)
@pns_news4 жыл бұрын
You can also write it as *(*(*(c+0) +0) +1) or c[0][0][1].
@namhuynh65344 жыл бұрын
For A[3][2][2], print A + 1, it should be *A + 16 (size of array [2][2]) but I got + 10. For example, if *A = 500 -> A + 1 = 516 but I got 510. Does someone know about this?
@allHailKingJulien4 жыл бұрын
For the same input, I am getting it alright, 504 and 520. Have you checked the code again? Also, which compiler and language are you using?
@namhuynh65344 жыл бұрын
@@allHailKingJulien I run the code on VS Code with Code Runner extension and the language is C++
@allHailKingJulien4 жыл бұрын
@@namhuynh6534 I am running it on the same setup, I have no clue where it would have gone wrong
@flying_Color9 жыл бұрын
Thank you very much !
@deepakarumugam58667 жыл бұрын
this statement int (*p)[3]=B didnot work well on my compiler is this statement int (*p)[3] like we are creating an array of pointers and so initialising an array this way didnot work or is this instruction int (*p)[3] compiler specific or is it neither way ...
@sahil10533 жыл бұрын
We can use void Func(int** A) for processing int B[2][3] but via auxiliary steps: int* p[] = {B[0],B[1]}; and int** pp =p;. So we pass Func(pp);
@yatinbahl62403 жыл бұрын
9:50
@hemanthbs26496 жыл бұрын
how to delete a particular data set from a 2D array??
@gshreyaa4 жыл бұрын
in *(c[1]+1) isnt c[1] a 2d array thus c[1]+1 should be c[2] and the ans should be 832?
@Anonymous-mz9un3 жыл бұрын
Think of it as like this. for each * you are gonna replace a + so c[0][1][1] = *(c[0][1] + 1) = *(*(c[0]+1) + 1) = *(*(*(c+0)+1)+1). So if you wanna get value in a c[10][20][30] say you want c[9][15][23] you can do it like c[9][15][23] = *(c[9][15] + 23) = *(*(c[9]+15)+23) = *(*(*(c+9)+15)+23) and &c[9][15][23] = (*(*(c+9)+15) + 23) (without first *)
@qwe1237278 жыл бұрын
You did not explain, why we cant say, `int b[2][3]; int *p = b;`, excluding the compiler warning
@maik58254 жыл бұрын
He said that in a video before. p can not be an int-pointer. p has to be a pointer to an array. So we write `int (*p)[3] = b;` to say, that p is a pointer pointing on a int array with the length of 3. Edit: And now we can use this like `int x = p[0][1]` or `int y = *(*(p+0)+1)`.
@maso553 Жыл бұрын
if the **A just won't work, how does **argv work ?
@mrpossible56965 жыл бұрын
You are awesome
@ElAbdoullah5 жыл бұрын
Hi, just a question about the function taking a pointer to a 2D array as argument. You used A[ ][2] as parameter, butwhat if you don't know the size of that array ?
@azizas936610 жыл бұрын
hello sir : i have one question ? is not c[1][0] = 7,9 you wrote c[0][1] = 7,9 i do not know why ? Thank you
@shahariaraitul30514 ай бұрын
can't believe I have the same question after 9 years! i was looking for the answer here but it seems I wouldn't
@tomasz-rozanski7 жыл бұрын
Looking at the picture it seems that there's three 4-element arrays. The 2-element arrays are not emphasised enough in my opinion. That's my only criticism; the rest is awesome as always.
@tehseenakhtar79144 жыл бұрын
very useful
@ankitbhardwaj95666 жыл бұрын
Sorry I got my answer it was running in a code ,,,he has explained its answer as 800 earlier for our understanding
@abdullaharean3 жыл бұрын
You are boss!
@Olavotemrazaodenovo4 жыл бұрын
Excelente
@tejashreeingale70954 жыл бұрын
I have doubt in *(C[0][1]+1) can be represented as &C[0][1][1]= 812 but you write 9, how?
@Anonymous-mz9un3 жыл бұрын
no *(c[0][1] + 1) = c[0][1][1] the value;
@Anonymous-mz9un3 жыл бұрын
Think of it as like this. for each * you are gonna replace a + so c[0][1][1] = *(c[0][1] + 1) = *(*(c[0]+1) + 1) = *(*(*(c+0)+1)+1). So if you wanna get value in a c[10][20][30] say you want c[9][15][23] you can do it like c[9][15][23] = *(c[9][15] + 23) = *(*(c[9]+15)+23) = *(*(*(c+9)+15)+23) and &c[9][15][23] = (*(*(c+9)+15) + 23) (without first *)
@Anonymous-mz9un3 жыл бұрын
So the ans to your question &c[0][1][1] == (*(*(c+0)+1)+1) without the covering *
@joshsha653711 жыл бұрын
My friend, you do have advance knowledge in C; but the way you are explaining in the video doesn't focus on a larger audience. Why don't you just simply use matrix memory address to explain multi-D arrays to make it easier rather than in a complex one block of memory location. Remember, not everyone has a degree in computer science while learning C in youtube. But I truly appreciate your videos.
@mycodeschool11 жыл бұрын
Hi Josh, We want to keep our videos as simple as possible. May be showing a 2-D memory block would have been better, but the idea here was to show how exactly 2-D arrays are stored in memory and interpreted during pointer manipulation. Memory should always be looked upon as a 1-D array of bytes. Anyway, i take your feedback. :)
@raziuddinmohd7 жыл бұрын
Sir, I salute your dedication to sharing the knowledge, I request you to do the same in the future.So that the student community can get helped with your knowledge.
@aarushiaiyyar7 жыл бұрын
Sir, please don't change your style of teaching because an in depth knowledge of how pointers are stored in the memory is necessary! :)
@fathimhiri59264 жыл бұрын
god bless you inchallah
@subdivisionalmass8 жыл бұрын
If you need a template, here is a nice one I created that can help you understand better hopefully. pastebin.com/A28MEwvk
@pythonenthusiast92924 жыл бұрын
but for address we use %u right?
@serhiy20206 жыл бұрын
this reminds me of the movie Inception
@mithoonkumar96049 жыл бұрын
u r awesome :)
@ankitbhardwaj95666 жыл бұрын
Can anyone in this universe please explain me why the output at 12:53 is not showing 800 please.............reply...........soon.............
@abhishekkumarsingh60906 жыл бұрын
i don't know
@vijayendrasdm11 жыл бұрын
int (*p)[3] =B if I try to something like print (*p)[0] // 2 print (*p)[1] // 3 print (*p)[2] // 6 Now print (*p)[3] should throw me error but this prints 4 why ?
@djamelbgd301 Жыл бұрын
int mtx[2][2] = {0} int *(p)[2] = mtx; DOES NOT WORK , WHYYYYYYY??????????????
@Abc-me2cx Жыл бұрын
*should be inside like (*p)[2]. you can use chat gpt for this problems
@sahil10533 жыл бұрын
this seems simple ......... this is !!! but this is not !!!😒😒