What Are Pointers? (C++)

  Рет қаралды 558,295

javidx9

javidx9

Күн бұрын

A bit different from me, but I felt like I needed a reference video that explained a few things about pointers. Included are the very basics, memory allocation, problems to avoid and smart pointers.
This video is aimed at those earlier on with their programming journeys.
/ discord
Blog: www.onelonecoder.com
Twitter: @javidx9
Twitch: javidx9

Пікірлер: 779
@Ureallydontknow
@Ureallydontknow 3 жыл бұрын
"basic use of pointers"
@starpjor
@starpjor 5 жыл бұрын
David, you should have "in depth c++" series created. Keeping such precious knowledge to yourself is a crime :D
@javidx9
@javidx9 5 жыл бұрын
Hi Aleksei, I may do a C++ series next year, it depends, there are already a lot of resources available, but I have been considering doing a short run of "Back To Basics" videos
@TahirGluttony
@TahirGluttony 4 жыл бұрын
@@javidx9 hey dude, really appreciate you sharing the delicate yet easy to understand explanation on such a crucial topic. please make the "back to basics" video :)
@edwin3928ohd
@edwin3928ohd 4 жыл бұрын
@@javidx9 it's been a year! i would love a series like this
@maycodes
@maycodes 4 жыл бұрын
@@javidx9 please consider it or Can you share resources ?
@DannyOvox3
@DannyOvox3 4 жыл бұрын
javidx9 please do it, I will be starting a course in it but your KZbin videos will be a life saver I’m sure
@joshlovesfood
@joshlovesfood 3 жыл бұрын
This guy is a genius, he is gentle, and wants everyone to learn at their own pace and on their own terms. He explains things like a gentleman and holds no judgement or arrogance towards others. He is in fact a PhD holder in Computer Science, as well as an experienced professional in the real world. It does not get any higher for anyone. He is undoubtable worth his weight in gold. Creative minds like this belong on the edge of technology and business
@WomboBraker
@WomboBraker Жыл бұрын
Well said
@OikPoinFive
@OikPoinFive 2 ай бұрын
Grrrr!
@_rcs
@_rcs 5 жыл бұрын
This channel is such a gem, thank you Javidx9.
@javidx9
@javidx9 5 жыл бұрын
Hey no problem Rory, thanks!
@YoomarTuNoOmar
@YoomarTuNoOmar 5 жыл бұрын
"I think I have covered all of the most basic uses of pointers in C ++" 41:28 I can not even imagine the advanced.
@mehmetakyuz5290
@mehmetakyuz5290 5 жыл бұрын
rofl tru dat
@arnolduk123
@arnolduk123 4 жыл бұрын
I think the advanced uses of GOTO would be a good appetizer too..LOL.
@harrymack3565
@harrymack3565 4 жыл бұрын
21 hours later, 13 skull fractures form banging your head in your desk and wall, mid level brain damage from drinking 92 redbulls, damaged vocal cords from screaming at your screen and your eyes in a constant clash between dryness from looking at a screen for so long and wetness from the pool of tears your formed before your tear ducts where completely empty, you understand the advanced parts if pointers.
@Mateus.007
@Mateus.007 4 жыл бұрын
int *(*f(void (*)(void *))(void *);
@xrafter
@xrafter 3 жыл бұрын
@@Mateus.007 This is bad and hard to read i hope no one use it.
@pro4skill
@pro4skill 3 жыл бұрын
12:00-12:10 "The pointers work in a space defined by the type of object they are pointing to" - This was extremely helpful and concise
@kamilbizon8317
@kamilbizon8317 5 жыл бұрын
I've seen 4+ c++ pointer tutorials, and this one is the best one. You managed to explain the basics really well. I hope you will find time to make more videos covering the basics of c++
@javidx9
@javidx9 5 жыл бұрын
Thanks Kamil! I'm thinking about doing some sort of "C++ Basics" series, but there are a lot of resources already out there. I'll keep thinking about it though for the new year.
@stackercoding2054
@stackercoding2054 3 жыл бұрын
I was understanding everything (kinda) until 21:15, after that I lost track of what you were doing, I need to rewatch this many times but this is pure gold, I would like to express my deepest thanks to you for taking almost an hour of your life to share this super useful knowledge.
@MikeMcRoberts
@MikeMcRoberts 2 жыл бұрын
Same here. Exact same point in the video I got lost.
@NN-uy6ik
@NN-uy6ik Жыл бұрын
Same 😂
@jonnymcgrath4816
@jonnymcgrath4816 6 ай бұрын
Same here. You commented/watched this video 2 years ago. How is your programming skill in C++ now? Are you able to understand beyond 21:15?
@jonnymcgrath4816
@jonnymcgrath4816 6 ай бұрын
@@MikeMcRoberts Same here. How is your programming skill in C++ now after a year ago of watching the video? Are you able to understand beyond 21:15?
@barathkumar6903
@barathkumar6903 2 ай бұрын
@@MikeMcRoberts R u Zoro?
@milkjs
@milkjs 3 жыл бұрын
You're teaching this for free when I pay thousands for a shitty explanation in school. God bless.
@Ironlionm4n
@Ironlionm4n 2 жыл бұрын
Oof this one hit hard today
@akashverma4280
@akashverma4280 4 жыл бұрын
32:05 Chrome: Got some RAM? OS : Actually ther... Chrome : Thanks!
@Leonhart_93
@Leonhart_93 3 жыл бұрын
It can have all of the memory of my PC, if that's what it takes to run at max speed. The OS will afterwards balance it as needed by other programs.
@akashverma4280
@akashverma4280 3 жыл бұрын
@@Leonhart_93 Chrome takes advantage of OS generosity, lol. What does it need 40% RAM for when only 1 tab is open smh.
@Leonhart_93
@Leonhart_93 3 жыл бұрын
@@akashverma4280 Define 40%. Is it of 4, 8 or perhaps 16 GB? I have 16 GB and 2 screens of Chrome with about 10 tabs each and the total consumption is ~2 GB RAM according to Task Manager. That is too little imo. Certainly not enough to warrant this imfamous reputation I see everywhere. i.imgur.com/MPhDt4T.png
@akashverma4280
@akashverma4280 3 жыл бұрын
@@Leonhart_93 40% of my 4 Gig RAM on my potato pc. Sorry I'm broke. Multitasking becomes pain in ass. Although I've stopped Windows Update manually to allow some free RAM. I didn't mean to smear the reputation of Chrome. It's the best browser I've ever used.
@gondoravalon7540
@gondoravalon7540 3 жыл бұрын
@@Leonhart_93 "That is too little imo. " Too little? What do you mean?
@charlesbaldo
@charlesbaldo 4 жыл бұрын
I have not done C/C++ in 20 years. I miss it. Thanks fir the stroll down memory lane.
@thomasg5554
@thomasg5554 4 жыл бұрын
Well you'll still miss your C/C++ memories from 20 years ago when you start reading about C++11 and discover "smart" pointers.
@N.A._McBee
@N.A._McBee 3 жыл бұрын
I watched this once, and I'll watch this even twice or thrice or whatever it takes to thoroughly understand what's going on here. This is one of the best educative videos I've ever seen. I think it'll take me weeks of playing and experimenting with code to figure out the complexity of this stuff. Thank you very much!
@nahbruhwhat
@nahbruhwhat 4 жыл бұрын
Excellent! This is as calming as watching a documentary about lions on the savanna!
@kaloyanvylchev3818
@kaloyanvylchev3818 5 жыл бұрын
Vector memory allocation was amazing, makes so much sense! Thanks for taking your time to explain it in such depth!
@TheNormalUniverse
@TheNormalUniverse 3 жыл бұрын
Lol I love the “what are pointers” Art!
@asifzamanpls
@asifzamanpls 3 жыл бұрын
Nicely explained! Definitely one of the best programming channels on KZbin that actually explains things in-depth.
@JamesStocks
@JamesStocks 4 жыл бұрын
Awesome video. Usually an explanation of pointers is just the first minute of this, and an assertion that they're really straightforward. Never usually go further and actually deal with how they can be confusing. Thank you!
@fenril6685
@fenril6685 Жыл бұрын
This is one of the absolute best videos on the internet regarding pointer fundamentals. I recommend this to people who are new to the language any time I see them struggling to really grasp what pointers are and how they work. One thing I do wish you had gone over in this video (and would perhaps be a good topic for a supplementary video) is the differences between taking parameters by value, by reference, by pointer, by pointer to pointer, and by reference to pointer which I find to be the most common 4 ways to pass values into functions. For instance, when you start needing to develop application layers that are doing low level operations (like pointer arithmetic on a byte buffer), it can be very easy to make mistakes like not realizing that you need to either return a modified pointer from the function so that you can use the updated memory address externally or take a reference or pointer to a pointer as the parameter type. Also, I like your bit about smart pointers at the end, however, I think a good rule of thumb is that smart pointers are useful when they are being used how they were intended to be used, which is to denote ownership and not just "because it's modern". In otherwords if this is a low level piece of code that needs to be closely managed and optimized, like designing a custom data structure like an Octree implementation, then it is not a good idea to use smart pointers. If however, you are working on systems within an API where you need to denote "has-a" relationship component ownership of difference objects, then having unique and shared pointers can be useful and appropriate there.
@Temulgeh
@Temulgeh 4 жыл бұрын
I just started c++ and without having seen the entire video, I already know this will be gold
@nekoill
@nekoill 4 жыл бұрын
Instantly liked after the definition of a pointer without a prompt. Also, I've been inexplicably drawn to C++ since I was a teenager, but couldn't quite start learning it, but now there's a huge KZbin library, so what better time to start learning.
@upyours2707
@upyours2707 5 жыл бұрын
I just found your channel a couple of days ago and already subbed and bingewatched a good chunk of them. Very informative and I learned lots of things. Thank you for sharing your knowledge.
@tahwnikcufos
@tahwnikcufos 5 жыл бұрын
Probably the single most import concept in C++ to grasp, and even more so, the most butchered topic you'll ever find in books.
@javidx9
@javidx9 5 жыл бұрын
It is indeed a hugely important concept, and it also is important in other languages too, even though it may not be explicit. I think video is a good format for pointer understanding as it shows you things moving around in memory, something a book can only hint at.
@valizeth4073
@valizeth4073 5 жыл бұрын
Agreed, pointers are seen as this powerful tool that nobody really understands. It is really powerful indeed, but they aren't complex or anything.
@samdavepollard
@samdavepollard 3 жыл бұрын
@@rockapartie looks like a book i'll find useful - thanks for mentioning it
@joestevenson5568
@joestevenson5568 3 жыл бұрын
@@rockapartie Given that pointers are essentially the same between the two (implicit void* casting aside) it sounds like that might be the go to for c++
@framepointer
@framepointer 3 жыл бұрын
@@joestevenson5568 C also does not have passing by reference.
@fundamxd
@fundamxd 4 жыл бұрын
Hi David, I've just started watching your videos these last days and they are just fantastic and so helpful and I really love the way how you explain things and teach them. As a beginner, I really want you to mak. A series of full courses about C++ to teach us the fundamentals and the basics and also the advanced stuffs about C++ that will really help us and motivate us to learn more and more and it will also help you too as this channel owner. So much respect to you sir, Thanks.
@finmat95
@finmat95 3 жыл бұрын
31:25 mindblowing part. In my university, professor gave us a programming exam that used pointers to vector cells. You're so clever.
@ZOMGWTFALLNAMESTAKEN
@ZOMGWTFALLNAMESTAKEN 4 жыл бұрын
32:00 ah yes, that deserves a sub
@achtsekundenfurz7876
@achtsekundenfurz7876 3 жыл бұрын
32:05 _ayyy lmao_
@luketanner6373
@luketanner6373 4 жыл бұрын
I really appreciate your delivery and concise examples and descriptions. Keep it up! :D
@georgebradley4583
@georgebradley4583 3 жыл бұрын
Note to myself: What I’ve learned from this video. Pointers are variables that hold memory addresses. You need to specify what datatype the pointer points to. A pointer of int can’t point to a double. A pointer of int can point to a memory address that stores an int value. Pointers are used in polymorphism to point from a base class to a derived class and have different types of objects (which all have one thing in common, they’re derived from the base class) this means it’s valid for an array or a vector to store both the base class object and derived class object in the same container and treats them as all the same. Thanks so much!
@flioink
@flioink 4 жыл бұрын
"The name of the array is a pointer" which I remember from other lessons. When the "*" is used to request the value of some pointer variable is called "dereference" as far as I understood it. int a = 5; int* b = &a; cout
@reenamola2162
@reenamola2162 2 жыл бұрын
the word dereference isn't intuitive. "value of operator" makes far more sense
@davidbailey1777
@davidbailey1777 4 жыл бұрын
Great video! I’ve almost no programming exp and I could still mostly follow this. The sketches were a critical part of making this work. Well done!
@TomJez100
@TomJez100 5 жыл бұрын
PHENOMENONAL VIDEO!! Very well thought out and presented. Excellent coding examples that reinforce understanding with illuminating graphics. Perfect amount of depth for a real fundamental base in a simple and easy-to-understand manner. A sign of a true expert with much experience who can also teach. Great job!!! Poignantly Pointing to the Point of Pointers without being Pointless. ;)
@Bolpat
@Bolpat 4 жыл бұрын
Every time you say "Asterix" for asterisk, I cannot stop myself thinking: Why don't we call "&" the Obelix operator?
@inigo8740
@inigo8740 4 жыл бұрын
One is rather small, the other one is round and large. Seems very fitting.
@ng4logic
@ng4logic 4 жыл бұрын
That is genius. People should adopt this. Its very easy to remember and it makes sens
@achtsekundenfurz7876
@achtsekundenfurz7876 3 жыл бұрын
It's a miraculix nobody thought of that before! :D A few funny names for special characters: # chainlink fence / tictactoe @ paperclip § fidget spinner ! baseball bat ~ wavelet ^ party hat ° halo
@tonyfremont
@tonyfremont 3 жыл бұрын
@@achtsekundenfurz7876 I just wish people would learn the proper names for (), [] and {} = parenthesis, brackets and braces, with the latter two having the optional modifiers of square and curly respectively, if 9ne must. There's only one set that should ever be referred to as brackets [] the other two are not brackets, ever. ;)
@achtsekundenfurz7876
@achtsekundenfurz7876 3 жыл бұрын
@@tonyfremont Tbf, "parenthesis" sounds like an ugly medical condition, so I can understand why few people use that word...
@ArturKorobeynyk
@ArturKorobeynyk 5 жыл бұрын
Absolute GEM! It is not only easy explanation to general pointers but also to virtual functions and memory allocations and smart pointers which are rarely touched by any topic named C++ pointers. Thumb Up-ed, subscribed and shared.
@javidx9
@javidx9 5 жыл бұрын
Hi Artur, I really appreciate that, thanks a lot!
@josiahmartin6463
@josiahmartin6463 2 жыл бұрын
This video is awesome 👌 I've been struggling with pointers for awhile and you explain the concepts clearly and throughly
@markonikolic1386
@markonikolic1386 4 жыл бұрын
Awesome channel! We were learning OOP this year at uni and the subject of pointers was confusing for most. It is a shame this video found me only now, but I will surely go back to it whenever I want to make sure that I am using pointers correctly and cleaning after myself. Pointers get confusing when I start using arrays of pointers and matrices of pointers which are required in the exercises we get. THANK YOU SO MUCH! Keep up the good work!
@SumoCumLoudly
@SumoCumLoudly 5 жыл бұрын
I already know pointers but have to say I like your way of teaching, very polished, succinct and thorough. I like how you don't assume too much knowledge and quickly explain or elaborate things that some people might not know.
@johnwoolley2198
@johnwoolley2198 4 жыл бұрын
I've seen a lot of material trying to introduce pointers and I have to say I think yours is the best and most intuitive of them all, and it's free!
@burntt999
@burntt999 2 жыл бұрын
Hola Javid, thank you for all these great free lessons. Back here rewatching this because I ran into the smart pointers in the breakout PGE tutorial wiki and it threw me way way off then I remembered you had a pointer video. Thankfully! You’re incredible for making all these educational videos and making them free. I would be way behind where I am now in my programming journey if you never started this channel. I am incredibly thankful for all your work.. thank you, thank you, thank you.
@javidx9
@javidx9 2 жыл бұрын
Thanks for your kind words Lee, it's always pleasing to hear when someone has found the videos useful, and it keeps me motivated to keep going - which I will in the new year!
@DevranUenal
@DevranUenal 4 жыл бұрын
KZbin was on Auto Play mode and suddenly this video came up. I'm so happy that I didn't skip. This is by far the best introduction I've ever got into pointers. So far, no book was able to teach me what you did in a couple of minutes. And +1 for the Chrome joke :D Edit: I forgot to say thank you. So: Thank you!
@javidx9
@javidx9 4 жыл бұрын
lol, cheers Devran! :D
@merthyr1831
@merthyr1831 3 жыл бұрын
I managed to complete a programming test for a post-grad job with this refresher on ptrs! thank you
@DassVeryGood
@DassVeryGood 2 жыл бұрын
I might be learning on my own, but this is single handedly the best video on pointers! might be just the basics, but its an actual comprehensive explanation of those basics that make it understandable. Thank you so much for your help, LEGEND
@godsstepson1495
@godsstepson1495 Жыл бұрын
About to go back to college and I basically know nothing pertaining to C++ but watching this is getting me excited and wanting to understand more.. I'll be coming back to watch these in the future once I understand the language and can pick up on everything your teaching.. thank you, this is what I needed to remember if I still had the drive to learn like I did in my younger days.
@methodinsane
@methodinsane 4 жыл бұрын
Just found your channel. Exceptional tutorials, thank you so much for this stuff. I learn some c/c++ years ago but just find these explaining these concepts. Cheers!
@alexvanheerden5702
@alexvanheerden5702 5 жыл бұрын
Thank GOD for C#. Though your demonstration of polymorphism is somehow better than any other I've seen in higher level languages like C# which is a huge credit to your manner of explanation.
@SCARRIOR
@SCARRIOR 3 жыл бұрын
C# is such a lazy language
@alexvanheerden5702
@alexvanheerden5702 3 жыл бұрын
@@SCARRIOR What you call lazy, I call Abstraction 😋
@charlesmayberry2825
@charlesmayberry2825 4 жыл бұрын
12:40 in, things that will catch an unaware programmer... in my best 6th sense voice "I see dead references"... also memory leaks. Now that I've watched the video I'm really glad you hit on both of those points. In fairness, Pointers were the hardest part of C++ for me to get my head around. I've found that smart pointers simplify some processes when doing engine programming that relies on entangled subsystems (game engines are BAD about that) Weak and strong pointers become handy at that point. It does not make up got GOOD habits, but it IS useful.
@Chemateur
@Chemateur 5 жыл бұрын
I'm not sure if someone already pointed this out, but the reference at 29:40 is unnecessary. The reference would be needed if you were actually changing the pointer inside of the vector but the delete operator doesn't do that, it only changes the memory that's being pointed to by the pointer. Using: for (auto a : vSomeVector) delete a; would still work just fine, since it would create a copy of the pointer, and delete would still deallocate the memory location that's pointed to. You can double check that the pointer itself is unmodified by printing the value of each pointer in the vector before and after the delete. The address they hold should stay the same, even though the memory they point at becomes invalidated. Not really important, but figured I'd share anyway just in case someone was interested :) I love the video by the way.
@Sparkette
@Sparkette 3 жыл бұрын
Just finished pointing this out myself. Glad I'm not the only one who noticed. :) Was surprised to hear him make such a critical error in his explanation, but I guess it happens to the best.
@josephmills1104
@josephmills1104 5 жыл бұрын
When you made that large section of memory in your picture for RAM I immediately thought you were going to say that it was fir chrome, and you did. Lol, thanks for that.
@RozzmanLists
@RozzmanLists 5 жыл бұрын
Even though I haven't progressed to using C or C++ yet, but learn some basics about programming using mainly Lua and Python, I found this video - and many others from you too - VERY useful. Your clear and organised style of explaining is a joy and it is very easy to follow you. Your dry sense of humor adds to the fun. Thanks for your efforts, javidx9
@javidx9
@javidx9 5 жыл бұрын
Hey no problem and thanks Rozzman!
@lnagy88
@lnagy88 5 жыл бұрын
I'm a C# developer and used C and C++ at the university. Modern C++ used with VS just fascinates me, please do more C++ videos and if you could do some compares with C# it would be very helpful. Thank you for the great video on pointers!
@bjbell52
@bjbell52 Жыл бұрын
I've always considered C# to be Borland's Delphi with a C syntax.
@AlexSmith-fs6ro
@AlexSmith-fs6ro 4 жыл бұрын
I love smart pointers. In a large application, I would rarely use a raw pointer. Should the object get deleted, all other raw pointer that reference are now dangling. No fun to debug if you dereference. A pointer used to reference a newly created object in the free store, in the presence of exceptions, you get memory leakage. I always use a unique_ptr when a object in the heap is initially created, in case of exception later in the code. Great vids, learned loads from you.
@cruelplatypus67
@cruelplatypus67 3 жыл бұрын
So I learned c++ in school and college and didn't know what & and * was all about, thanks for the in-depth explanation. Thank you so much.
@Ochenter
@Ochenter 3 жыл бұрын
Really clear and understandable, David. Nice video as always. Merry Christmas.
@javidx9
@javidx9 3 жыл бұрын
Merry Christmas Daniel!
@anastasiak8589
@anastasiak8589 2 жыл бұрын
Fantastic approach to presenting complicated information. Great video
@loristinelli-hf3ml
@loristinelli-hf3ml 7 ай бұрын
Thank you for making this video, it took me a few days to watch it, bc I was really trying to understand everything, but I've made it. I can finally say I know what pointers are and it's all thanks to you!
@TheMedia325
@TheMedia325 5 жыл бұрын
Super helpful video, all the concepts are very thoroughly explained, really appreciate uploading of these videos.
@javidx9
@javidx9 5 жыл бұрын
Hi Idaisa, cheers!
@adrianj9695
@adrianj9695 4 жыл бұрын
Again. Thank you!!! I will now feel comfortable taking this class.
@pharazon5865
@pharazon5865 3 жыл бұрын
thank you very much for this kind of detailed video, was super helpful and easy to follow. I'm new in C++ and it helped me a lot
@uuu12343
@uuu12343 5 жыл бұрын
Holy heck javid, i never fully understood pointers for the longest time doing c++, i now have a reference guide for pointers fundamentals...and actually understanding the darn things
@javidx9
@javidx9 5 жыл бұрын
That's great to hear Eternia, thanks!
@prdxflf8451
@prdxflf8451 5 жыл бұрын
just found the channel today, great videos. Love this video so in-depth taking the time to explain everything. Great Job! Also learned something new that the visual studio debugger can do.
@javidx9
@javidx9 5 жыл бұрын
Hey welcome aboard Captain Pizza and thanks!
@AngelTaylorgang809
@AngelTaylorgang809 4 жыл бұрын
Wow this video is freaking awesome, this man was born to teach. Subscribed
@mannhansen9337
@mannhansen9337 3 жыл бұрын
Thanks. This is the best pointer tutorial I have ever seen. You made pointers understandable.
@user-jm7jh7hv5h
@user-jm7jh7hv5h 2 жыл бұрын
Excellent. The most clear explanation i've ever heard! Thank you very much, you are so kind to share your knowledge
@hipwave
@hipwave 4 жыл бұрын
note, when casting to int the address of pointers to char (about 17:20 ) , compile will fail unless the flag -fpermissive is enabled.
@renatodex
@renatodex 3 жыл бұрын
That's true, I had the same problem. An alternative is to use `intptr_t` as cast.
@iwanwilaga
@iwanwilaga 4 жыл бұрын
Hilarious start around 01:15 .. :D and now i continue my journey towards the 2nd minute. Best wishes! (update, i finished watching this episode, ultra-invaluable, perfectly crafted and articulated knowledge. As usual. Although i'm nobody in C++ yet, but surely got hyped and inspired by watching the Right materials on the web.. ^^ God bless you : )
@GPTDavid
@GPTDavid 4 жыл бұрын
I will replay this video as many times as it takes for me to grasp the idea of pointers. i'm not kidding.
@grayaj23
@grayaj23 3 жыл бұрын
Circa 1985-ish, I started down the path to a CS degree. It was probably called something like IS or MIS at the time. The school I was at structured this so that first-year programming courses were taught in Pascal. Second-year was in C. Of course, we didn't call it "K&R C" at the time, because the ANSI standard wasn't complete yet. I noticed during the C part of the program that in every class, there would inevitably be someone sitting in the front row who, sometime well past the first week or two of class, would suddenly ask "Wait. What's a pointer again?" Pascal had pointers -- oversimplified and of limited utility, but clearly pointy pointers used to point at things. How do you make it as far as an upper-division class in a discipline that critically requires a good understanding of pointiness and then ask "wait, what's a pointer?" This would bring the entire class to a screeching halt for a week while the Prof set about clearing up the confusion of a student who would inevitably take a W anyway. This happened in at least three different courses, and with a different person each time. And THAT, my friends, is why I bailed on software as a career and became a Certified Netware Administrator and embarked on a career in Ops, where our job is to make the product look like it works properly.
@altSt0rm
@altSt0rm 3 жыл бұрын
Clear, concise. Excellent as always.
@napalmpig3772
@napalmpig3772 5 жыл бұрын
The problem I have with pointers is that as a beginner, you don't know when or why you would use them. I was fine with the concept of storing an address, but at beginner level you aren't writing very complex code and you cant see why you would want to store an address. It seemed like it was just a way to break encapsulation to access some variable. Not to mention the fact that there are references as well which are similar enough to cause more confusion.
@APaleDot
@APaleDot 4 жыл бұрын
Pointers are really fundamental, and I would hope that students learn them early. They should be taught as a way to refer to a very large piece of data. For instance, if you wanted to load an entire image from the hard drive, there is no way you could just fit that in a normal variable; the stack is just too small. So, you ask the operating system for a big chunk of memory, and it gives you a pointer to that memory. Obviously, there are other uses as well, but this is the most direct and understandable, IMO.
@wellalrightythen5941
@wellalrightythen5941 3 жыл бұрын
wow, thank you. All i gada say. I don't know why i decided to jump in and take on c/c++ as the first languages i learn, should have started with python. (I ended up learning python just as a result of getting frustrate with c++, started dipping into it and right away just seeing how simple it is in comparison and how the language it self clearly states the intent of the code, I ended up taking a break all together from c ++) Your videos though make it really easy for me to understand the things i was struggling with so I'm back on it now. Blows my mind how much information is out there and in so many formats. I can go through 10 videos some times and still not understand something and then finally find someone that just explains it in a way, in full detail very clearly so i can grasp it. What ever some of you guys are making in add revenue, isn't enough for the value in the content your putting out, that's for sure.
@CarlWiles
@CarlWiles 3 жыл бұрын
Not sure what pushed this video into my YT feed, but you earned a new subscriber today. Your teaching style is amazing.
@javidx9
@javidx9 3 жыл бұрын
Thanks Carl!
@imrank340
@imrank340 Жыл бұрын
Undoubtly perfect "Englishman" made a C++ Pointer subject made easy and eloquently explained its inner working, briskly introducing smart pointer. Good (imaculate) work David.
@maycodes
@maycodes 4 жыл бұрын
This was so ENLIGHTENING ! , Really I was confused just because of what you pointed out, Using * to declare and to to get value of.. Thank you so much.🙏🙏
@tmcowley
@tmcowley 4 жыл бұрын
you have a clear talent for teaching, thanks so much for this
@botobeni
@botobeni 3 жыл бұрын
ur a legend man, best C++ channel on youtube
@YoungOrbital
@YoungOrbital 5 жыл бұрын
Great video Javidx9 , really enjoyed it
@javidx9
@javidx9 5 жыл бұрын
Cheers Sanjeev!
@jakobfredriksson2272
@jakobfredriksson2272 3 жыл бұрын
I thank you so much for this javidx9. I don't know why something that's not really complicated for some reason is, or was for me. I'm learning to code "in reverse"; went from an interpreter language backwards and now learning C and lol, I hadn't even heard of "pointers" before this endeavor =)
@erikpavlusik6214
@erikpavlusik6214 5 жыл бұрын
Thank you for being so kind and patient.... very good explained :)
@javidx9
@javidx9 5 жыл бұрын
Hey no problem Erik, thanks!
@rockyrivermushrooms529
@rockyrivermushrooms529 5 жыл бұрын
still trying to wrap my head around pointers. This video helped so much! I need to practice because that's how I learn best.
@javidx9
@javidx9 5 жыл бұрын
Its all about the practice, videos, guides and tutorials will only get you so far, at some point YOU need to write the code.
@adempenver9416
@adempenver9416 5 жыл бұрын
excellent explanation, definitely cleared up a couple of things I misunderstood about the language.
@javidx9
@javidx9 5 жыл бұрын
That's great to hear Adem, I tried with this video to show lots of other "interesting" things to put pointers in a broader perspective, so I'm pleased it helped.
@rezafathi4367
@rezafathi4367 2 жыл бұрын
The best explanation on pointers ever! I really hope you would create more c++ videos🤘
@misuw_
@misuw_ 4 жыл бұрын
One of the best videos! A Pointer is just a variable that holds a memory address.!!
@deadwhenifoundher
@deadwhenifoundher 5 жыл бұрын
Fantastic job! Your explanation is very clear, and very helpful.
@javidx9
@javidx9 5 жыл бұрын
Thanks Michael, that's appreciated!
@Saranwity
@Saranwity 2 жыл бұрын
Invaluable video on pointer topic. Thanks.
@mevalia
@mevalia 3 жыл бұрын
Amazing video. But for those trying today 16:20 : Char* cannot be cast into integer on 64bits system. So don't do: (int) pLocation0 but (void*) pLocation0.
@alchavez2616
@alchavez2616 4 жыл бұрын
Haven't programmed in C/C++ in a while. This brings the joy back
@iwir3d
@iwir3d 4 жыл бұрын
Okay saw the console game engine, and the pixel engine, and now this. I hit subscribe, and I am not disappointed at all. Keep up the great work!
@paulferreira1441
@paulferreira1441 4 жыл бұрын
Wonderful teaching style!
@JP-nj2sl
@JP-nj2sl 3 жыл бұрын
Very clear explanation of pointers!
@Karsteski
@Karsteski 4 жыл бұрын
This was an excellent video, thank you very much for making it :)
@user-fd6fx1tb5k
@user-fd6fx1tb5k 3 жыл бұрын
very informative, and helped me greatly to understand and more importantly less fearful of use of pointers
@AdamMohamed-cq9fv
@AdamMohamed-cq9fv 3 жыл бұрын
in 40 minutes you cleared up what my professor couldn't explain in 3 hours, thank you
@antongorobets9146
@antongorobets9146 3 жыл бұрын
Great video. Thanks for the vector drawings in RAM! very clearly
@damianc8738
@damianc8738 3 жыл бұрын
Oh man, i've spent nearly 5 hours on a video, which is about 45 minutes long. From one video, i went on few other videos about pointers, even guys who were doing map and pictures from the pointers but still, this one was the best. Thanks man! And i have to go sleep cuz i need to wake up early..
@Zakru
@Zakru 3 жыл бұрын
32:03 "Here, we've got Chrome" lol
@dwivedys
@dwivedys 2 күн бұрын
This is simply next-level amazing and it’s from 5 years ago! Wonder where you are David!?
@enjoyinglife9853
@enjoyinglife9853 4 жыл бұрын
Thank you for this amazing video!
@Wrtvrxgvcf55
@Wrtvrxgvcf55 5 жыл бұрын
mate, i cant tell you how many times your videos have helped me out. thanks!
@javidx9
@javidx9 5 жыл бұрын
Hey no problem buddy, good to hear.
@breathermachine
@breathermachine 5 жыл бұрын
An interesting thing to note is that there's really no external "pointer" pointing to an array when you declare one. From the programmer's point of view, the declaration only allocates (sizeof(type) * number of elements) bytes, nothing more. The compiler/linker just makes array access/pointer arithmetic easier by "assigning" to an array A the address of the first element.
@javidx9
@javidx9 5 жыл бұрын
A great point John
@breathermachine
@breathermachine 5 жыл бұрын
@@javidx9 Haha, no pun intended! :)
@rdoetjes
@rdoetjes 3 жыл бұрын
I have had many interns who don’t understand the concept of pointers. And initially I didn’t understand because it so fundamental to CS. Then I found out that college students don’t get a semester of assembler programming anymore. And then it fell into place. So initially I took an hour to bring them up to scratch. And during those sessions I noticed that the * is very confusing to them in C (C++) as it basically means two different things. As an assignment and an operator for dereferencing aka getting the value from that address the pointer is pointing to. Then all of them understood. But I still am amazed how you can get through 4 years of college in Computer science and not fully understand the fundamentals of a computer.
@2k7u
@2k7u 2 жыл бұрын
This vid helped me get back on track, thanks lol
@marmoripelaao9830
@marmoripelaao9830 5 жыл бұрын
6 minutes in and I feel like a professional already!
@javidx9
@javidx9 5 жыл бұрын
Hi Marmori, Don't rush these things :D
Programming Panning & Zooming
25:06
javidx9
Рет қаралды 64 М.
Back To Basics: C++ Containers
31:41
javidx9
Рет қаралды 174 М.
Зу-зу Күлпәш. Стоп. (1-бөлім)
52:33
ASTANATV Movie
Рет қаралды 1,2 МЛН
Glow Stick Secret 😱 #shorts
00:37
Mr DegrEE
Рет қаралды 138 МЛН
“Act On Press” - John Carmack's Hot Take On UI
7:54
Theo - t3․gg
Рет қаралды 55 М.
what even is a "reference"?
5:44
Low Level Learning
Рет қаралды 115 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2 МЛН
Bjarne Stroustrup - The Essence of C++
1:39:11
The University of Edinburgh
Рет қаралды 1,2 МЛН
Practical Polymorphism C++
41:44
javidx9
Рет қаралды 124 М.
POINTERS in C++
16:59
The Cherno
Рет қаралды 1 МЛН
Svelte 5: Compiler, Signals, and Web App Performance - JSJ 627
1:21:52
Pseudo 3D Road #8 - infinite vegetation, tunnels, city
5:34
Jason Doucette
Рет қаралды 3,9 М.
Обманет ли МЕНЯ компьютерный мастер?
20:48
Харчевников
Рет қаралды 182 М.
A4 Reset to zero
0:26
STYLE YT
Рет қаралды 17 М.
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 6 МЛН
🤔Почему Samsung ПОМОГАЕТ Apple?
0:48
Technodeus
Рет қаралды 390 М.
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 2 МЛН