REFERENCES in C++

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 621

  • @LuskyMJ
    @LuskyMJ 3 ปีที่แล้ว +390

    I'm laying with my phone at 3:14 am on christmas eve and watching c++ tutorials. What has my life become.

    • @lucasgroves137
      @lucasgroves137 ปีที่แล้ว +12

      Yes. That is sad.

    • @LuskyMJ
      @LuskyMJ ปีที่แล้ว +68

      @@lucasgroves137 I actually felt pretty happy at that moment.

    • @lucasgroves137
      @lucasgroves137 ปีที่แล้ว +2

      @@LuskyMJ So you were crying wolf. And on Xmas Eve too. 😄

    • @SOME_BORED_GUY
      @SOME_BORED_GUY ปีที่แล้ว +16

      After a year now I'm sure that you realized you did the right thing 👍

    • @lilfelix8955
      @lilfelix8955 ปีที่แล้ว +4

      At least you have a good taste in Anime girls

  • @ToxicityGameDev
    @ToxicityGameDev 7 ปีที่แล้ว +1294

    I think I'm going to comment on every one of these videos.... Again, hands down, best C++ videos on the web... hands down.

    • @benjaminf.3760
      @benjaminf.3760 6 ปีที่แล้ว +8

      agree

    • @GfastGao
      @GfastGao 6 ปีที่แล้ว +1

      Any reason with that? Said little boy?

    • @masasikisimoto26
      @masasikisimoto26 6 ปีที่แล้ว +5

      Have you guys seen Bucky's C++ tutorials? They are much better.

    • @michaelm.3641
      @michaelm.3641 6 ปีที่แล้ว +69

      @@masasikisimoto26 Bucky covers a lot and does it quick, but he doesn't go to the same depth that Cherno does when describing concepts. Speed isn't always better, and Cherno ensures to cover a lot of important concepts that Bucky doesn't necessarily get to in an appropriate manner. That being said I enjoy both of their videos.

    • @sarveshkaran9380
      @sarveshkaran9380 5 ปีที่แล้ว

      Truly appreciate these stuffs.
      Its a bench mark for a standard video

  • @KamilKhanYT
    @KamilKhanYT 5 ปีที่แล้ว +394

    He talks about references like the priest talks about angels.

    • @ppbb6699
      @ppbb6699 4 ปีที่แล้ว +4

      that's right

    • @HaragothNAR
      @HaragothNAR 4 ปีที่แล้ว +18

      It really is fascinating, I lost my shit when I learned about pointers/references.

    • @RanMC9918
      @RanMC9918 3 หลายเดือนก่อน +1

      "glazing" in 2024 slang

  • @joebruh8230
    @joebruh8230 2 ปีที่แล้ว +52

    That incrementing integer through memory addresses part is what really blew my bloody mind. Lower level languages never cease to surprise me. Coming from python, I feel like I'm capable of black magic now.

    • @NphiniT
      @NphiniT ปีที่แล้ว

      Black magic 😅

    • @theseangle
      @theseangle ปีที่แล้ว +4

      Wait till you learn C

    • @NovacStudios
      @NovacStudios 5 หลายเดือนก่อน

      Trust me my mind is more blown im coming from roblox studios Luau 💀

  • @beebstergames7348
    @beebstergames7348 2 ปีที่แล้ว +14

    I have been a 'C' programmer for over 40 years. I was a systems programmer for Unix. I came here to get an explanation of Variable References and I just want to say thank you. I watched a few other videos but this was the best explanation. Thank you for being simple, concise, and clean in your explanation.

    • @Hoptronics
      @Hoptronics ปีที่แล้ว

      ​@@forbidden-cyrillic-handle same.

  • @daginganinja4075
    @daginganinja4075 4 ปีที่แล้ว +64

    The most articulate videos regarding computer programming that I have ever watched! I know this is a very "old" video at this point and, perhaps, there are better ones to comment on but there are clearly still people benefiting spectacularly from this series. I guess you're still the best of the best!!

  • @AlexTheGreatish
    @AlexTheGreatish 6 ปีที่แล้ว +15

    5:34

  • @alsayedalsisi2709
    @alsayedalsisi2709 7 ปีที่แล้ว +22

    Man, you're really awesome. I have seen many many tutorials in many topics before, but I have never seen such high quality nor someone who has such knowledge or clear way to explain things like you.
    I am really a big fan of yours.

  • @etiennewijler6830
    @etiennewijler6830 4 ปีที่แล้ว +84

    Mate, your videos are the best. Just to give you some insight into the variety of your target group and the impact that your videos are having: I'm an assistent professor in Econometrics at a top international university. As part of my research, I have developed novel statistical estimation procedures that work great for high-dimensional datasets (big data). The estimators can be computationally heavy and I have always programmed them in R, which made the computations painstakingly slow. A year ago, with the help of your videos, I made the switch to C++ (through the use of Rcpp) and my code has sped up x100. Not only have I been able to obtain valuable scientific insights by means of simulations a lot faster now (and publish them faster in academic journals), I have also turned my code into R packages, backprogrammed in C++, and made it available for other researchers. This explanation on passing by reference alone has saved me and researchers using my package a ton of time! Thanks a lot and please keep doing what your doing.

  • @omearsaeed
    @omearsaeed 6 ปีที่แล้ว +282

    Truth be told! your explanations are much much better than the paid lynda courses on C++! Thank you for these amazing videos!

    • @biqbicle4982
      @biqbicle4982 2 ปีที่แล้ว +5

      yeah maybe cause your teacher probably never had a job at ea💀 its the hard truth

  • @Aaronmac404
    @Aaronmac404 6 ปีที่แล้ว +179

    Once C++ starts clicking for you, it REALLY makes sense. Damn. No wonder this shit has been industry standard for so damn long.

    • @contruq
      @contruq 4 ปีที่แล้ว +1

      i kinda got problems with learning C++, so i rewatch these vids

    • @DragonKidPlaysMC
      @DragonKidPlaysMC 3 ปีที่แล้ว +2

      @John McGee rust will take over c++

    • @hmthatsniceiguess2828
      @hmthatsniceiguess2828 3 ปีที่แล้ว +14

      @@DragonKidPlaysMC Rust isn't taking over anything, definitely not C++. You don't realize what you're saying. Apart from some more narrow use cases, C++ will reign supreme for a long time.

    • @comradepeter87
      @comradepeter87 3 ปีที่แล้ว +3

      @@hmthatsniceiguess2828 Almost the entirety of Firefox is written in Rust. Chromium has started including Rust in it. Hell, even the Linux kernel, which shunned C++ from its codebase, is going to start using Rust in it.
      C++ is fun to write and experiment in, Rust is not. It's a bit locked down. Rust is fun to write a serious application, when memory leaks become a serious issue and GC isn't an option and smart pointers are too much of a runtime overhead for you liking.

    • @kallht2079
      @kallht2079 3 ปีที่แล้ว

      I really hope I'll reach that point

  • @gabrielmaria2762
    @gabrielmaria2762 6 ปีที่แล้ว +1

    Watching some of your videos as a total beginner in C++ and coding in general I'm like "Oh, now I get it" in the first half to "What the..." towards the end of the video. Great work by the way! Thanks a lot!

  • @roboking1020
    @roboking1020 3 ปีที่แล้ว +13

    I'm not exactly sure if this series is beginner friendly. There are places where if I was a beginner, I feel like I'd be totally confused (then again that might not be the case for everyone). But as an intermediate programmer coming from C#, this stuff is pure gold. Super helpful and very well explained.

    • @AlaaAreesPhoenix
      @AlaaAreesPhoenix ปีที่แล้ว +7

      no this series is clearly not to follow from scratch , but when u get familier with basic stuff this is 100% the best place to come.

    • @heavymetalmixer91
      @heavymetalmixer91 ปีที่แล้ว +3

      As you say, it's not mean for beginners in programming. But, if you already know the basic concepts of programming like variables, conditionals, loops, functions and clases, then this course is really good.

  • @michaelm.3641
    @michaelm.3641 6 ปีที่แล้ว +4

    Thank you Cherno for your high quality videos. I don't normally do projects in C++ but I needed to create a plugin for a program that is written in C++ and your videos made this a breeze.

  • @jeremygong4190
    @jeremygong4190 3 ปีที่แล้ว +3

    that 3 types of input is amazing! basically included everything you need to know to take advantage of pointer reference and a single variable. Amazing vid!

  • @BennyCevs
    @BennyCevs 4 ปีที่แล้ว +16

    dude these videos are like three years old now so idk if you're gonna read this but you are so helpful thank you so much

  • @davidbatetc
    @davidbatetc 7 ปีที่แล้ว +151

    These videos are so useful! Thank you for your time :)

  • @platch23
    @platch23 5 ปีที่แล้ว +28

    Every video in this series is absolute gold. Such clarity.
    I'm curious how much of this changes with C++14

    • @daniazzam1161
      @daniazzam1161 2 ปีที่แล้ว

      I am new to this series, is there a lot of changes in the newer Cpp versions?

    • @wowvain2989
      @wowvain2989 2 ปีที่แล้ว +1

      @@daniazzam1161 newer CPP versions almost never affect core concepts such as variables, normal pointers or references so you dont have anything to worry about. Only the advanced concepts of the langauge can change with a new CPP version/standard

  • @CheatCodeSam
    @CheatCodeSam 6 ปีที่แล้ว +14

    Currently reading through "the C++ programing language 4th edition" and these video help understanding it immensely. Thank you!

    • @MsJavaWolf
      @MsJavaWolf 5 ปีที่แล้ว +1

      Great book. Once you read a certain level I would recommend it to every C++ programmer, even if it can be a bit scary at first.

    • @mastershooter64
      @mastershooter64 4 ปีที่แล้ว +3

      @@MsJavaWolf so... once you learn the basics of c++ you should read "the C++ programming language 4th edition"?

    • @MsJavaWolf
      @MsJavaWolf 4 ปีที่แล้ว

      @@mastershooter64 I've read it a few years after I started learning c++, so I already knew a bit more than just the absolute basics but I think you can also read it earlier. I would not recommend reading it in the first few weeks or so though, because it is very technical and might be confusing.
      But I think at some point it's very helpful, it's very thick and thorough, it filled many small gaps that I had als self taught c++ programmer.

  • @Tracks777
    @Tracks777 7 ปีที่แล้ว +70

    Great content

  • @QuintinMassey
    @QuintinMassey 3 ปีที่แล้ว +2

    Oh man… this was exactly what I needed to see. Thanks for showing the simple example with the reference to a first, then confusing the crap outta me with function example where you use de-referencing and pointers, then getting me back on track with the pass by reference example. I needed to see the easy then convoluted case before I could understand why the final example was the way to go. You clearly thought that through. You’re awesome.

  • @w3w3w3
    @w3w3w3 5 ปีที่แล้ว +3

    Best c++ videos on the web! Thankyou.

  • @SanteriP
    @SanteriP 3 ปีที่แล้ว

    Seeing this video after the pointer video actually also made pointers way clearer to me as well once you started comparing their functionality at the end of the video. Amazing stuff.

  • @Fronzel.Neekburm
    @Fronzel.Neekburm 3 ปีที่แล้ว +1

    From an old 'C' programmer trying to break old habits and fully convert to 'C++' way of things, these videos are awesome. Short, simple and to the point and even work at 1.5 playback speed. I now have the urge to find out when references was added to the language and if it has anything to do with ".Net"'s arrival?

    • @juniorcomsono
      @juniorcomsono 3 ปีที่แล้ว

      are you watching his videos on 1.5 playback? i'm even struggling on the normal speed lol

  • @DwightJames-t8v
    @DwightJames-t8v ปีที่แล้ว

    This series of videos is very beginner-friendly, the first half of the series is very detailed, but the latter is a brushstroke, all in all, very well done!!!

  • @tomatofractal
    @tomatofractal 7 ปีที่แล้ว

    Dude, you dont know how much I owe you.
    I think that I already saw at least 2/3 of all of your videos.
    I'm graduating in computer science and..I was really dismotivated... I have nice grades and all, I understand the theoretical part of the classes but I was getting dismotivated at each semester and no interest at all in coding. Your videos gave fresh air to me and to my graduation.
    You're trully amazing.
    thanks.

  • @jerryleemelton1860
    @jerryleemelton1860 5 ปีที่แล้ว

    I just recently discovered your channel and I must say I agree wholeheartedly with a lot of the other viewers who say that this is the best C++ resource on TH-cam! Thanks so much for the fantastic content! Your channel has been invaluable in my quest to learn C++!

  • @interstellarj5218
    @interstellarj5218 5 ปีที่แล้ว +14

    I love your no-nonsense explanations in clear english! Please take my horse as payment.

  • @DarkblueRadiance
    @DarkblueRadiance 6 ปีที่แล้ว +1

    Thank you so much for making these videos. I'm a self-taught programmer when it comes to C++ and C (in uni we only learn Java) and until just now I never really grasped the concept of pointers and references. Awesome work and great explanations!

  • @thestarinthesky_
    @thestarinthesky_ 5 ปีที่แล้ว +1

    I have been too lucky to find this course today in TH-cam. It is 12:35 am and I can’t stop watching these amazing tutorial. You should be teaching at Harvard. Please upload videos on optimized C++

  • @Nam_David
    @Nam_David ปีที่แล้ว

    The instruction is really clear and on point, I won't be confused the notion of Pointer and Refference anymore. Really thank you

  • @THEBLOODYCKANDY
    @THEBLOODYCKANDY 6 ปีที่แล้ว

    You really know how to explain things with precision. Not everyone has the ability to do that. This series is amazing and I hope you keep updating it cuz it`s really needed.

  • @TheChemicalBassist
    @TheChemicalBassist 5 ปีที่แล้ว +2

    Even though this is about references... Ironically this is an excellent video displaying the usefulness of pointers. Your examples and explanations are top tier.

  • @ganeshshenoy2615
    @ganeshshenoy2615 6 ปีที่แล้ว

    Thank you for that quick summary for the documenting the use of pointers and references as alias/ address alloc. I will come back to this video every time I run into a snag. Thanks again.

  • @Sarah-pf4ec
    @Sarah-pf4ec 7 ปีที่แล้ว +5

    This video series has been extremely helpful, thank you for making them.

  • @chomiyeons
    @chomiyeons ปีที่แล้ว

    i used to struggle with pointers and references but this video rlly helped me a lot. thank u cherno

  • @md.rezwanferdous2874
    @md.rezwanferdous2874 6 ปีที่แล้ว

    You just got a permanent fan, i just can't say student for now coz i'm not learning c++ right now, but really inspired by your videos, keep up the good work man.
    Thank you so much for giving us awesome videos like this.

  • @yumje3377
    @yumje3377 2 ปีที่แล้ว +1

    You explain every concept in a so concise and understandable way. Helped me a lot. Thx.

  • @teo-medesi
    @teo-medesi 4 ปีที่แล้ว +2

    The fact that this is one of the best courses for learning C++, In-depth theory, and clean code and it's free just boggles my mind.

  • @manuel_youtube_ttt
    @manuel_youtube_ttt 5 ปีที่แล้ว +32

    Better explanation than the one found in the "The C++ programming language" by the creator of C++. There I didn't understand a bit. Here I swiftly got it! Thanks!

    • @nexusclarum8000
      @nexusclarum8000 5 ปีที่แล้ว +11

      In books like that they don't try to be easy to understand. They try to be precise. Well, being easy to understand isn't the primary objective at least.

    • @klarnorbert
      @klarnorbert 4 ปีที่แล้ว +1

      I also got a book from him, but it's like he's talking alien.

    • @nexusclarum8000
      @nexusclarum8000 4 ปีที่แล้ว +8

      @@klarnorbert The issue with certain books is they assume prior knowledge in certain areas. It's like if you picked up a calculus book it's going to assume some prior math knowledge. Computer science and programming books can be very much the same. If you're an absolute beginner or nearly that then its something worth looking into before buying a book.

    • @joelcurtis562
      @joelcurtis562 4 ปีที่แล้ว

      @level90s Second this. Great book. Make sure to get 2nd Edition.

  • @polymakegames
    @polymakegames 4 ปีที่แล้ว +1

    Lmao. A few years too late Cherno, but I straight failed my CIS class that just taught basic C++ because of this particular chapter kicking my ass.
    Your explanation just cemented what I felt I found out while working in Unreal engine with their Blueprints. But I was never able to grasp it in a pure C++ environment. Now I do.
    Thank you man.

  • @imanhn
    @imanhn 4 ปีที่แล้ว

    I really enjoy your videos cause not only I don’t need to fast forward it, but sometimes I have to even pause to check out the codes!

  • @begum5207
    @begum5207 4 ปีที่แล้ว +1

    I just want to say thank you. Your teaching is so good.

  • @cheemsinu2147
    @cheemsinu2147 4 ปีที่แล้ว +1

    Thanks for this awesome C++ tutorial series :)

  • @TJBEATSAMV
    @TJBEATSAMV 2 หลายเดือนก่อน +1

    Love how you used the references tutorial to further explain pointers xD

  • @alphatier4919
    @alphatier4919 6 ปีที่แล้ว +69

    By the way... This:
    #define LOG(x) std::cout

    • @konsulan7576
      @konsulan7576 5 ปีที่แล้ว +13

      @@rrmm5453 Because 16 in binary is 0001 0000. He is bit-shifting it to the left by 2 (16

    • @RandomDays906
      @RandomDays906 5 ปีที่แล้ว +8

      @Neel Shukla when the preprocessor sees '

    • @idk-bv3iw
      @idk-bv3iw 5 ปีที่แล้ว +6

      @@RandomDays906 The preprocessor doesn't see anything, it just copy-pastes code and just replaces x with the argument. So std::cout

    • @piechulla1966
      @piechulla1966 5 ปีที่แล้ว +3

      @@idk-bv3iw This is why Stroustrup (and everybody else) warns against the preprocessor. Or at least against overuse. But most of the time we are working with 'legacy code', so we have to be aware of the pitfalls and endure the headaches.

  • @ch3dsmaxuser
    @ch3dsmaxuser ปีที่แล้ว

    On of the clearest explanations I've ever seen, kudos to you, for being so clear.

  • @stephenwu4379
    @stephenwu4379 6 ปีที่แล้ว

    This is the BEST C++ videos ever! The concepts and examples are very clear and it is very useful!

  • @serhiy2020
    @serhiy2020 4 ปีที่แล้ว

    Best and most simple explanation on pointers and references.
    I think it's better to use pointers instead of referees because it communicates clearly that we're passing a pointer to a function and as a result the variable can be variable can be changed.

  • @satellite964
    @satellite964 5 ปีที่แล้ว +6

    This little 10 min video could've saved me so much pain back in 2016 when I was doing CS at uni. -__-

  • @t.i.theking7960
    @t.i.theking7960 5 ปีที่แล้ว

    I cannot believe that there are people who would actually dislike that man's video for fck sake I do not believe that someone can actually come up with a better explanation than this. Congs man love you.

  • @kinsondigital
    @kinsondigital 5 ปีที่แล้ว

    This is by far the best explanation I have seen about references and its relations to pointers. Very awesome!!

  • @juanpablogomezgarcia1835
    @juanpablogomezgarcia1835 4 ปีที่แล้ว +2

    Best c++ series ever, i understand pointers in 30min after 5 years in college :(

  • @X3lnThPi
    @X3lnThPi 2 ปีที่แล้ว

    I was frustrated with this & but now it seems all clear, everything makes sense now. ThankYou

  • @flamag7346
    @flamag7346 2 ปีที่แล้ว

    The best tutorials I found so far. Explanations are clean and understandable. Much better than my school.

  • @comodinoh
    @comodinoh 2 หลายเดือนก่อน

    ngl this is the best and most intuitive C++ series i've ever seen

  • @Thadnill
    @Thadnill 4 ปีที่แล้ว +1

    I am serious when I am saying that you are probably the only youtuber that doesn't make me lose concentration or fall asleep after 10 minutes! Thank you

  • @ManpreetSingh-cs5kp
    @ManpreetSingh-cs5kp 4 ปีที่แล้ว +1

    Cherno is doing a great job, a true dev , learned from his known experience and sharing it in terms which a normal person can easily understand.

  • @jasonmathew33
    @jasonmathew33 7 ปีที่แล้ว +17

    Thanks for the video! Are you going to be discussing data structures, algorithms and design patterns at all later in this series? just curious

    • @TheCherno
      @TheCherno  7 ปีที่แล้ว +37

      Absolutely.

    • @angelojulioth3616
      @angelojulioth3616 7 ปีที่แล้ว +2

      Yes, I want to see you cover those topics, specially, data structures and sorting algorithms. I love you Cherno!

    • @matthewe3813
      @matthewe3813 4 ปีที่แล้ว +3

      @@TheCherno when a comment to a comment has more likes than its parent comment

  • @calibr0636
    @calibr0636 4 ปีที่แล้ว

    this video actually made what pointers are more clear to me, thanks man

  • @jonforhan9196
    @jonforhan9196 2 ปีที่แล้ว

    I LOVE this video totally changed the way i look at C++ and what i can do you are amazing

  • @pavanmadhyasta7743
    @pavanmadhyasta7743 ปีที่แล้ว

    Perfect tutorial series, truly awesome

  • @vincentm99
    @vincentm99 7 ปีที่แล้ว

    4:04 the best explanation ever of function, thank you soooo much

  • @crazychase443
    @crazychase443 10 หลายเดือนก่อน

    years of trying to understand references, and now after one of your 10 minute videos i've finally got it. THANK YOU!

  • @jacobgordon9770
    @jacobgordon9770 5 ปีที่แล้ว

    Your video is clear, concise and filled with helpful examples. Great series Cherno!

  • @akshaymanthekar1032
    @akshaymanthekar1032 ปีที่แล้ว

    Thanks Man... Very well explained the concept of references!

  • @Chevifier
    @Chevifier ปีที่แล้ว

    My god, all the bulbs are going on(off?). Im enjoying each and every one of these video and also coding along as well using VSCode on Linux. You are a God send👏

  • @2khz
    @2khz 5 ปีที่แล้ว

    Seeing a man in his kitchen talking about C++ is bizarre, but a nice breath of fresh air from a man talking behind screen capture software

  • @Djzaamir
    @Djzaamir 7 ปีที่แล้ว +3

    Great video as always , even though i know these concepts but your videos further clarify my concepts Thank you.

  • @vimleshkumarkanaujiya
    @vimleshkumarkanaujiya 3 ปีที่แล้ว

    Your all videos are saving my life in August 2021. Thank you.

  • @kayumbamaxime8658
    @kayumbamaxime8658 3 ปีที่แล้ว

    thank bro, your explanation is so clear. i appreciate what your playlist

  • @루먀먀먕
    @루먀먀먕 3 ปีที่แล้ว

    Every time I want to get the variable's value and change that, I couldn't. But this way it could be sense! Thanks for making this awesome video!

  • @roja
    @roja 3 ปีที่แล้ว

    Commenting for your exposure. The best channel on TH-cam for C++ !!!

  • @jdvd
    @jdvd 6 ปีที่แล้ว +3

    Hey, great work. I am refreshing my C++ and your videos are great.
    However, I'd like to point this out:
    int a = 5, *p_a = &a, &r_a = a;
    r_a += 5;
    std::cout

  • @jeanahollings
    @jeanahollings 3 ปีที่แล้ว

    there's a nonsense quote on the internet quoting einstein (the nonsense part is that he probably didn't say it) that says, "If you can't explain it simply, you don't understand it well enough." you are the epitome of this. you explain things in regular terms, things that too many teachers explain like it's freaking magic. thank you, is what i'm saying, thank you for explaining this so simply and clearly. thank you.

  • @harshsinghi2142
    @harshsinghi2142 4 ปีที่แล้ว

    By far the best content and explanation on C++ !

  • @Konslufius
    @Konslufius 3 ปีที่แล้ว

    I used & in Parameter for quite sometime now and I never realised that it's actually the memory address I'm referencing.
    I finally start to understand the importance and usefulness of pointer and memory addresses.

  • @bobas5948
    @bobas5948 4 ปีที่แล้ว

    omg, he just said "very simple stuff", while my brain is short circuiting.
    all jokes aside, you really are the best c++ coding instructor here.

  • @gijimbo1337
    @gijimbo1337 3 ปีที่แล้ว

    This is still the most intuitive video I've ever seen on C++ references.

  • @teacup3000
    @teacup3000 6 ปีที่แล้ว

    I was struggeling with a similar problem, and this just makes so much sense now! Thank you.

  • @aMulliganStew
    @aMulliganStew 5 ปีที่แล้ว

    Syntactic sugar, indeed. Here's a fun little experiment to try at home:
    int *pi = new(int);
    int& ri { *pi };
    ri = 6;
    cout

  • @whalingwithishmael7751
    @whalingwithishmael7751 4 ปีที่แล้ว

    Thank you. Your videos are deeply appreciated.

  • @wallaceobey651
    @wallaceobey651 7 ปีที่แล้ว +23

    *subscribes* Also, if you have time I'd really appreciate a data structures playlist in C++ specifically.

    • @obama7563
      @obama7563 3 ปีที่แล้ว +1

      look up mycodeschool they have alot

  • @Matt23488
    @Matt23488 5 ปีที่แล้ว +2

    References always slightly confused me before. Like, I've understood how to use them but I have always been confused about the actual difference between pointers and references. Your explanation that references are syntactic sugar for pointers makes perfect sense and completely eliminated the confusion. Thanks! Great series!

  • @narayanbhat3279
    @narayanbhat3279 4 ปีที่แล้ว

    By the setup seemed like he's gonna cook something:) Very nice video

  • @HashKatYT
    @HashKatYT หลายเดือนก่อน

    I come back to this series all the time 7 years later and im still refreshing with it lol

  • @brillianttree3906
    @brillianttree3906 3 ปีที่แล้ว +1

    References do occupy memory since under the hood they are just pointers(can be seen using disassembler). But I guess it depends on compiler implementation. Just as you said they are supposed to be used as an alias. And they make the call by reference look a lot cleaner than the pointer version.

    • @Reydriel
      @Reydriel 2 ปีที่แล้ว +1

      I assume that, unless the reference is used to pass something to a function call (cuz the function needs to store that pointer somewhere), the compiler will just optimise it away as a simple alias in release mode. Maybe not in debug mode though

    • @brillianttree3906
      @brillianttree3906 2 ปีที่แล้ว

      @@Reydriel Sounds reasonable.

  • @onyinyechichukwuma689
    @onyinyechichukwuma689 3 ปีที่แล้ว

    Perfect example as always. Thanks for the series!

  • @samuelkovanko7198
    @samuelkovanko7198 3 ปีที่แล้ว +1

    I though pointers and references were way more complicated but this makes perfect sense!

  • @izzy-frizzy3771
    @izzy-frizzy3771 4 ปีที่แล้ว

    thank you for making this video, this last semester i had no idea what references were and they just popped up one day in my class and i was just lost

  • @erawanthewise8227
    @erawanthewise8227 3 ปีที่แล้ว

    You're so good at explaining keep it up!

  • @master138
    @master138 2 ปีที่แล้ว

    Thanks Cherno. very useful as always.

  • @ccgb92
    @ccgb92 6 ปีที่แล้ว +1

    5:58 OMG order of the operations! So that's why the (*value) is used instead of *value omg thx. always wondered that :O

  • @cetruonghai
    @cetruonghai 4 ปีที่แล้ว

    Best explaining ever I know! Amazing Cherno! I am one of your Patreon just want to donate ^^

  • @ykyjohn
    @ykyjohn ปีที่แล้ว

    variable are really just an reference to a memory if you will. A pointer is a special variable which holds memory address but essentially is a reference to a particular memory which will hold an address of another address of memory. The same comparison you did between types of memory. It all does about the same essential thing.

  • @meh1672
    @meh1672 7 ปีที่แล้ว +7

    You just explained my biggest confusion! :D

  • @gavinxu1622
    @gavinxu1622 3 ปีที่แล้ว

    Really simple explanation and easy to understand!

  • @calebsteinmetz9471
    @calebsteinmetz9471 4 ปีที่แล้ว +2

    I am a teaching assistant and research assistant at one of the top public universities and I have to say that this was one of the most concise explanations of references I have heard. It is sad to see that colleges can fail to convey information in an accurate yet digestible format. Often times professors try to show overly complicated examples or gloss over the basics.

  • @mgking777
    @mgking777 4 ปีที่แล้ว

    The best explanation video for references very good thank you so much !!!!

  • @wotchadave
    @wotchadave 6 ปีที่แล้ว

    Really excellent video
    What I mainly took away from this is that a reference can be thought of as an instance of a pointer?