Hi Mustafa, Please watch the complete video. That's the whole point that has been explained in the video that you cannot return pointer to a local variable. I think because you knew the concept already and you have this opinion that one cannot learn programming on KZbin, you got angry and skipped at 9:00. :)
@prankita1075 жыл бұрын
You are awesome . Make more videos and bless us please.
@adityaojha27013 жыл бұрын
Today everyone learns on KZbin and not only programing but everything. MyCodeSchool took initiative of making this highly valuable content during a time when people were using 2G. Then also your content quality is way better.
@mycodeschool11 жыл бұрын
Yes, printf is a library function. So, a stack-frame will be allocated for printf also. Sorry, i did not show it in my simulation. stack frame is allocated corresponding to each call of a function. So, if there are multiple calls to printf in the same function. stack frame will be allocated and de-allocated multiple times corresponding to each call of printf.
@everything91186 жыл бұрын
This man is lit. U teach so well. I have been in touch with c since 4 years, still didn't know these things. U r awesome!
@user-yg2gw4je8d8 жыл бұрын
This is an excellent series. In my view, your extended explanation/demonstration of pointers is especially good. Thank you so much for doing this.
@gijimbo13375 жыл бұрын
1st, I know this video was posted 6.5 years ago but good content is good content and is still valid today. What I'd like to add is that "delete ptr" should be used when we're done using it. After that, "ptr = nullptr" should also be used so we don't end up with a dangling pointer.
@soham27323 жыл бұрын
Hiiii I am from 2021 😂
@KT22672Ай бұрын
2024 Still valid Still goated
@shivamverma94474 жыл бұрын
This holy and sacred video cleared all the concepts...............
@amandeepsingh23148 жыл бұрын
you are awesome... great tutorial.. its really helped me a lot. you are doing a great job.
@vasanthidevipaneerselvam485 жыл бұрын
Excellent explanation of pointers... No words to tell...now got clear idea of all concepts in pointers ...watch all videos on pointer
@ozzyfromspace5 жыл бұрын
Wow, I don't know how you did that, but you made me understand. That's super hard to do lol 😅 You're amazing man, thank you!
@samvaidya19875 жыл бұрын
Every video has a ton of information. Very humbling. Thanks a ton!!
@elementallobsterx5 ай бұрын
Incredible explanation
@rajdeepkhandelwal16535 жыл бұрын
all I can say "Thank You for this pointer tutorial".(Awesome explanation)
@mycodeschool11 жыл бұрын
Thanks Bharath !! yeah, may be i should always write a free. If you see program will anyway finish execution after print where we are using the pointer to access memory. But anyway, its a good practice to write free explicitly.
@joshidikshya61834 жыл бұрын
Could you please explain where should free() be placed? Writing free on main will create a segmentation fault.
@satwaghole11 жыл бұрын
@kewlpint: Yes.printf() is considered as another function call and separate stack frame is allocated for it. Nice question. @mycodeschool: You r doing gr8 job boss.Go ahead..
@ankukumar78744 жыл бұрын
I don't have words to describe how excellent you are.
@naboulsikhalid77635 ай бұрын
programming C at the best. Born to teach elegantly. Thank you
@dogdutyascetic11 жыл бұрын
Simply brilliant. The explanation of using the heap as a way to pass values down the calling stack is brilliant.
@1990idris9 жыл бұрын
thank you very much. i read some books about c, but your explanation is the best. because you explain step by step.
@zarifahmed10245 жыл бұрын
I just paused the video in the middle to say that you my brother you are awesommmeeeee!!!!! Take love
@maheshrokade55 жыл бұрын
Bro.... thank you so...much.. your teaching is awesome😊 , no one actually touch such concepts but..you did...
@cajhdz2 жыл бұрын
Thank you very much, my mind was crashed because I didn't know the root cause of this behaviour You have a great! channel to learn from
@anondoggo5 жыл бұрын
I never understood cs this well before. Thank you!
@hamzaahmad94896 жыл бұрын
Since your playlist tells almost everything a beginner needs to know about pointers . Kindly rename it with "All you need to know about pointers" . I couldn't find your video easily although it was much better than all videos I saw on pointers.
@PrayingForYourWellBeing7 жыл бұрын
This guy is seriously amazing, no words to describe his ingenuity !!!
@rugri3 жыл бұрын
Best explanation ever! Thanks
@fyionyoutube2 жыл бұрын
At @6:40 time, you have compiled the code successfully, but in my compiler, it is having segmentation fault, as it is being a Darlington pointer. Please share your answer.
@user-rt2fm4cp12 жыл бұрын
Do you know how to correct this error ? I am also getting segmentation fault after writing exactly the same code in the video....You know any solution to it ?
@conquerorcj266 ай бұрын
I watched from the first video in this playlist upto here in one watch..This playlist made me relise and gave a realaly good uunderstanding also cleared lotta doubts on a project i did using dynamic memory allocation.Thanks a lot
@mycodeschool11 жыл бұрын
Thanks a lot :)
@ZeriAi3 жыл бұрын
I've been watching at least one of your videos each day Thank you for your content
@aloyrs Жыл бұрын
This video basically explains why there is error when using pointers on the stack as data can be deallocated , however in when using pointers in the heap data has to be explicitly deallocated or overwritten using free() which is handled by the programmer, so there will be no accidental deallocation of data unlike in the stack
@ShubhamSharma-qy8ti7 жыл бұрын
Great tutorial sir. I look forward to learning a lot from you.
@pronoob48903 жыл бұрын
This cleared my concept. Thanks a lot.🤗🤗🤗🤗
@cankocak1068 Жыл бұрын
Great explanation! This video shows why we should return a pointer from the function using dynamic memory allocation.
@sankarnampoothirikm39308 жыл бұрын
wow cooooooooool i was serching this for days u r the only one who cleared my doubt (my doubt was about array returning) you r god
@devesh5955it11 жыл бұрын
Rocking Dude :), The concept regarding Top to bottom and bottom to top of the stack is cristal clear... Thank a lot Bro :)
@bharathslip911 жыл бұрын
Excellent video demonstration about usage of pointers. Please release the memory which is dynamically allocated by Malloc in the heap.
@clintonahong10 жыл бұрын
Actually it seems very fast to learn the concepts.Although i listen slowly with pause and play again and again thinking all about the int* add(int *a,int *b).Now i finally understand the underlying concepts .Thanks to mycodeschool for such valuable lectures .
@sunandachowdhury1455 Жыл бұрын
Can you kindly explain why they used int *add? Don't we write the name of function at that place?
@rohithbhandari78366 жыл бұрын
You are just amazing. I have no words to say.Excellent teaching skills.
@Protick19946 жыл бұрын
Very nice brother, nice explanation. Thanks to you from bottom of my heart. Keep up the good work, best wishes
@rashigupta18134 жыл бұрын
Man! Thanks a ton. These videos are so easy to understand
@hardikraj94695 жыл бұрын
From where did you study these tehings? It would be really helpful if you could give the materials or the name of the books from where you studied the 'application memory'
@saiyaswanthreddyleagala7254 жыл бұрын
Massive respect !!
@joecort98905 жыл бұрын
What a master I was struggling with a linked list, and I thought it was something due to some of this, and I was right. Thank u.
@aptitudepointiit-bhu53582 жыл бұрын
Amazing Explanation !! 💛
@jdschlichting5 жыл бұрын
This was very easy to follow along with. Thanks!
@arafamahmood11 жыл бұрын
u explain very nicely!thanx for the lesson
@thestarinthesky_4 жыл бұрын
You are too amazing! you are extraordinary amazing! Google is lucky to have you. Wish you the best in the world! Thank you.
@sairajdas66925 жыл бұрын
Simply terrific explanation!!
@muhammadnaveed79532 жыл бұрын
Excellent demonstration on pointers and memory..
@utkarshkathuria29313 жыл бұрын
Hi, the code you showed in the video doesn't work
@viithalbhat56403 жыл бұрын
Amazing. Superb. Subtle. Love you.
@sameerabanu3293 жыл бұрын
Thanks for your tutorial. It is helping me alot. Please start posting more videos.
@alexanderschmidt89768 жыл бұрын
best possible explained, THANK YOU!
@SushrutKanetkar11 жыл бұрын
Excellent explanation man ! Thank you very very much !
@vidyarthi39444 жыл бұрын
Great explanation.❤❤❤❤❤❤❤❤❤❤❤💚❤💖💖💓
@drnovice612ita8 жыл бұрын
Illuminating explanation
@timoteisatmarean73917 жыл бұрын
Subscribed because of this video. Thanks!
@inderpreetsingh26587 жыл бұрын
I had a doubt.. at 13:50 why did you remove return '&'c and wrote return c; what would have happened if we still used & operator?
@mohamedamrali19937 жыл бұрын
I went down in the comment section, just to check if someone else had the same thought. I am thinking it's probably just a style thing... not sure if there was a real purpose for it. I am trying to think of it carefully.... If any other experienced coder out there could confirm with us, it would be highly appreciated!! Thanks
@aminemarzouki7947 жыл бұрын
+MoHAMED Ali No It's not a style thing. At the first time, he wrote INT c = *a + *b; so if we need to return the ADDRESS of c we must precede it with &. That's why he wrote return &c; After that, he changed the variable c of type int, to a pointer to int which is int*. Now we have int *c = ... If you want to return the address of c, you simply return c, because c now is NOT an int, it is a pointer to int. So return c will return the address of integer c, if you did return &c however, you'll return the address of the pointer c ( int*** c).
@Reflectives4 жыл бұрын
@@aminemarzouki794 I didn't go down to docs for that, but if I got it right "*c =" means put the result to this memory location. Otherwise it would go to the stack again
@sandeepkumawat49824 жыл бұрын
huhhh,,,,i got tired of writing positive feedback for this man in every video...but still i feel these appreciations are not much for his skills ^_^
@shezijalal177410 жыл бұрын
Awesome Explanation ! Thanks !
@mycodeschool11 жыл бұрын
Thanks Dev !
@rashmikiranpandit89625 жыл бұрын
amazing as always!
@garryharry10249 жыл бұрын
Amazing tutorial! Clear as always...
@vidyadherreddy251110 жыл бұрын
Really nice videos..simple explanation to complex concepts
@farhantanvir307311 жыл бұрын
very nice explanation. Thank you.
@MMABeijing2 жыл бұрын
that's amazing, I can not believe it. Thank you Coach
@mayankverma54904 жыл бұрын
Very valuable lesson......Thank you very much!!!!!!!
@dwivedys7 жыл бұрын
Simply brilliant tutorial. I like the way you deliver your lecture. Would like to connect with you
@sayantaniguha85194 жыл бұрын
Watch till 6:42 for concept of *Function returning Pointer* according to *Pointer ppt for DSA KIIT Class* .
@aleeibrahim86728 жыл бұрын
Explained pretty well!! thanks :)
@lukthi8 жыл бұрын
So clear to understand, thank u @mycodeschool
@gitakujur66606 жыл бұрын
Lucas Dantas . bulu
@rmarinero6 жыл бұрын
Amazing! great refresher and tutorial
@thenottakenone10 жыл бұрын
Really really good explanation
@nalia2011110 жыл бұрын
Your videos helped me so much! Thank You !:D
@mistersz10 жыл бұрын
Excellent Tutorial, Great Teacher, Thank you very much !
@kunalpanchal77515 жыл бұрын
Thank you for Blowing my mind.....
@zacian49414 жыл бұрын
you are a....LEGEND!
@Anddosdd11 жыл бұрын
Exellent video,ive learnt alot my friend
@nearriver817411 жыл бұрын
nice! I really love this video
@anchitbhushan61725 жыл бұрын
Can we use static pointer to integer variables to store addresses??
@vijaykumarreddyt32875 жыл бұрын
Yes we can use...as static variables are stored in static segment...the addresses of variables in this segment is unchanged until the complete execution of programme
@Naveen-ef2dg6 жыл бұрын
Worth of Time. kudos..!!!
@ОлегТокмачев-в9ц4 жыл бұрын
Cool! Thanks shedding light on this topic. Bless you! :)
@ramfattah211 Жыл бұрын
Thank you Harsha Suryanarayana AKA humblefool. RIP Legend.
@EngWorld-nr2ww4 жыл бұрын
Explained so well
@overclockinggames24197 жыл бұрын
this was great sir , a learned a new thing
@abhimanyumishra94559 жыл бұрын
You are simply genius..
@pranaysamrit89447 жыл бұрын
Your videos are sooo awesome
@yunustaliperol69124 жыл бұрын
Firstly, this is the best video ever on this topic for sure...But I have a question : Why the function ADD returning the "c" instead of "&c"??? It is returning "c" but we are writing the address of "c" in to the *ptr in the stack??? This confused me a bit...
@akshdeeprajawat96425 жыл бұрын
Take a bow sir !!!!!!!
@crazytech35196 жыл бұрын
really great work sir...
@youyiliu75566 жыл бұрын
Good, better, the best!
@manishthakur97975 жыл бұрын
Great Explanation!
@ranjithks79 жыл бұрын
The PrintHelloWorld() function overwrittens the address of *c in Add() is aweful. Good to understand the behavior of Call Stack
@zekininadresi6 жыл бұрын
IMO, this video is just amazing.
@someinteresting56293 жыл бұрын
Very clear. Thank you
@cyborgdale7 жыл бұрын
At 3:42 this is pass-by-pointer, NOT pass-by-reference. In pass-by-reference, you would call just as you would in pass-by-value but the parameter list would dereference the variables using the dereference operator '&'. The received reference variable is then an 'alias' and can be used syntactically just like a local variable without having to dereference. Changing this variable however would have scope OUTSIDE of the function and therefore change the corresponding variable in main(). The difference is that you can do "pointer arithmetic" on pointers (changing the address pointed to) but not on references.
@sarthakjoshi37977 жыл бұрын
In C language, passing by reference can only and only be accomplished using pointers. I think what you mean when you say pass-by-reference using "int& x" as parameter in a function is pass-by-reference in C++, which is a new concept in C++, not present in C. So this mycodeschool guy is kinda right:)
@cyborgdale7 жыл бұрын
Sarthak Joshi Actually what I meant to say was "pass-by-address" instead of "pass-by-pointer". I keep it straight in my head by "thinking" of it as "pass-by-pointer", even though that term is not correct. It helps me remember to use the dereferencing operator in the function parameter list and to dereference the variable in the function body, whereas pass-by-reference automatically dereferences. I should have used the proper term so, thanks for calling me out on it.