How to DEBUG C++ in VISUAL STUDIO

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • Twitter ► / thecherno
    Instagram ► / thecherno
    Patreon ► / thecherno
    Series Playlist ► • C++
    BEST laptop for programming! ► geni.us/pakTES
    My FAVOURITE keyboard for programming! ► geni.us/zNhB
    FAVOURITE monitors for programming! ► geni.us/Ig6KBq
    MAIN Camera ► geni.us/CYUQ
    MAIN Lens ► geni.us/ZM3CmG
    Microphone ► geni.us/wqO6g7K
    Slack ► slack.thecherno.com
    Stream ► / thecherno
    Website ► www.thecherno.com
    Facebook ► / thecherno

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

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

    2:33 - Please, if you're going to quote my parents, at least mention them in the description.

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

    You can feel that he really knows his stuff and spent years for it. I really appreciate how it is free for us to enjoy.

  • @jondoe79
    @jondoe79 6 ปีที่แล้ว +551

    The most enjoying C++ series ever

  • @wolfsnow711
    @wolfsnow711 4 หลายเดือนก่อน +16

    800 record? You were so underrated back then, considering that even six years later you still have the best C++ tutorial. The most precise, practical, professional, up-to-date and easy to understand.
    And you are so passionate in these videos too!
    I've had a headache trying to learn C++, because they only teach what the code means and how to set up the tools for compiling, but give no understanding of how it actually works top-down. It's so hard to grasp the process without CS education, I wasn't really learning and coding most of the time, but collecting scraps of information from different materials trying to build the image of how a process should work.
    But after your vids about compiler & linker I'm so fired up! I finally know what I'm doing when I write the code. I can't thank you enough!

    • @02quocanh7
      @02quocanh7 4 หลายเดือนก่อน +2

      Well, as a person who is having CS education (and still doing good), I realized that what I know is... almost nothing, compared with TH-cam academy in general and specifically in this series. Got to say that I also feel the same, and it helped me a lot, as now I really understand how things work, at least now it make sense.

    • @Dazed_04
      @Dazed_04 3 หลายเดือนก่อน +2

      Another CS fellow here, still in first sem. I wanna say that I can write code that's sufficient for problem solving but even if I get it to work without copying someone else's code there's still that question in the back of my head "but why?".
      Why do things this way, what it actually means. The whole reason I like coding in general is the sort of magical feel you get when you build something out of nothing (it's not the instant gratification I chase I swear ;) . But then you get stuck on these questions and it's like someone took away that magic, like everything you're doing is using someone else's power(which is both true and not true). So these c++ videos are a treasure trove that just never ends.

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

    you should sell those pillows as merch
    seriously, i'm sure lots of us would happily support the channel that way especially those who don't want to do the whole patreon thing

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

    Debugging is love, debugging is life. haha
    for real: I partially enjoy debugging, its like solving a puzzle.. It can get reaaally frustrating some times, and sometimes even irritating, but over all its a key part of coding and learning to code better I think :)

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

      ΜrCookie
      I once was using an external library and apparently my code kept crashing. Unfortunately I didn't trace it back to the library since the debugger told me a pointer was deconstructed (the class). After a few hours of hair pulling, I found out the library was manually calling the destructor.

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

      I find that the satisfaction of defeating a really nasty bug is one of the best feelings when coding!

    • @Manas-co8wl
      @Manas-co8wl 5 ปีที่แล้ว +4

      It's also the most defeating... I mean it's always so easy in hindsight. Makes you rethink your belief in your prescience

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

      Is this C/C++?

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

      But the real question is, do you chocolate chip?

  • @steele.in.motion
    @steele.in.motion 4 ปีที่แล้ว +22

    It's so great to find a series that teaches the way I learn. Thank you for the effort you put into this!

  • @Kanak_Bodkhe
    @Kanak_Bodkhe 9 หลายเดือนก่อน +12

    being able to watch the memory allocation that much close is fascinating for me, like you can actually see those value getting stored physically in that hardware is just amazing :O

  • @daisonc.a.2472
    @daisonc.a.2472 3 ปีที่แล้ว +14

    I always used print statements to check execution. Never thought that debugging could have be way easier than that. Thank you Cherno for teaching me how to debug.

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

    Much love, Yan. This is one beautifully executed series.

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

    For those not well versed in VS17, Ctrl+F10 (or right-click Run-To Cursor) is a better way of moving from an existing point, to another point in the code (i.e., skip through a for loop)

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

    wow i have a little bit of programming experience and this series has really helped me to understand the nitty gritty of the whole programming process. tysm for making this

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

    Love how you explains it first and show it after, it's like you are creating the dots so it's easier for us just to connect them

  • @JRCSalter
    @JRCSalter 6 ปีที่แล้ว +8

    Learning soo much from this series. Never knew you could view the actual memory. That is fantastic.

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

    If you're getting random stuff instead of the cc groups, one of the things you can do to fix it is check to make sure you're on the same solution platform (x86). Switching from x64 to x86 fixed it for me.

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

      Yeah I couldn't see the memory it said (error reading string), then I changed from x64 to x86 and it worked, even though my computer says it has a x64 processor

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

    Your timing is impeccable. Just when there's something I need to know like c++ header files or debugging in VS ( like today ) you upload a video on exactly that. Thanks!

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

    Thank you I just got into C++ a few months ago and in that i have learn a-lot from your videos using VS IDE. Keep it coming!!!

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

    thank you...i was a bit scared to play with memory and debugging but now i feel a bit confident. great video and thanks for codelite too. Its a nice simple ide

  • @MaxwellsWitch
    @MaxwellsWitch 6 ปีที่แล้ว +35

    4:25 Well, you taught me so much in two minutes. So I can see what the variables are set to without having to use cout

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

    Excellent! I'm learning a lot with your series! Please keep it up!

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

    This the best video I have ever seen in the Programming context.... I Love the way you teach it

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

    Thanks for this great series cherno loved your content even though not going to use in Game Dev, but still helped a lot:)

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

    I will definitely be buying some of your merch when I get my first job as a developer. You are a great teacher.

  • @Factory400
    @Factory400 5 ปีที่แล้ว +37

    REALLY wish I had this when I started programming. This is fantastic.

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

      Yeah that pillow looks great

  • @abhishekkumar-wm2ie
    @abhishekkumar-wm2ie 6 ปีที่แล้ว

    Hi Cherno. I just loved this series. Its a great fun. Please continue with this. Currently I will not be able to pay but definitely a lot of love n respect for what you are offering.

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

    Thank you. TQ. TQ. I just performed my first debugging for a program. I even ended up using the Memory Window to check the values in my array change right in front me (I was "stepping over") and see the problem. It just felt so good. Best Video Ever!

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

    I have no experience in programming and I have been learning c++ for 4 days. I had to watch this video 3 times to fully understand it, but it was awesome. Thank you!

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

    This is gold. I just started to learn C++ and I love it. Thank you 🙏

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

    This is so amazing!! Perfectly executed explanation. :)

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

    Thank you so much. It has been super helpful. I enjoyed watching these series of videos.

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

    Thanks for your work bro i learn a lot of your videos i never find a good tutorial fo visual studio and yours are the best regards

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

    Fantastic stuff! Great quality video and information. Much appreciated!

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

    Ohhh my goodness. I can finally see what is going on in the background while writing code. Can’t believe I’ve been going to school for more than 2 years and nothing like this was ever mentioned.. how??? God bless you The Cherno

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

    Literally the best C++ tutorial series on the internet, thank you!

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

    This tutorial is really exciting! Cheers!

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

    Best C++ videos on youtube, love this series, hope there's more

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

    love your vids,full with interesting details

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

    In my University we use Visual Studio as IDE in most of the classes and I took C, C++ and C# courses using this IDE yet I am just learning to debug

  • @SayoPla
    @SayoPla 25 วันที่ผ่านมา

    Coolest thing in c++! made me understand header files more by just playing around with it!

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

    I absolutely love your work !

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

    Really incredible stuff even years later thanks!

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

    Thank you for these series

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

    thank you for the incredible videos you make!

  • @user-hb4ii5co3j
    @user-hb4ii5co3j 3 หลายเดือนก่อน

    The most entertaining C++ series to date and do you have lessons about flutter mobile?

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

    15:30 - actually, at the end of the loop it will run i++ first, and then do the comparison to check if i < 5

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

      ++i should increment before the comparison, i++ should compare then increment. Unless you are saying that i++ is the last part of the "for" statement and so i++ will increment at the end of each pass. Easy to test by printing i to the screen in the body of the loop.

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

      @@mytech6779 I just tested and what @Flaming Taco says is true.

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

      @@mytech6779 I know this is a really late reply, but this is incorrect. ++i and i++ don't make a difference in the header of a for loop (I believe this is because modern compilers optimize i++ to ++i). However when assigning a variable it does make a difference. If you have a variable x and its value is 7, when you do int j = ++x; the value of j will be set to 8 because the increment operator is applied to x before assignment. However, if you do int j = x++; then the value of j will be set to 7 because the value of x is assigned to j before it gets incremented.

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

      I have found this to be accurate. I was watching i, and it said i was 4, but it was grayed out, apparently it becomes "undefined" after the for loop.

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

    so much to learn from your videos thanks again.

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

    Thank you for amazing and really useful lessons!

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

    I think the fact I did not learn how to use the debugger caused that I didn't become a programmer, I used printfs to debug my programs on uni and it was very frustrating and stopped my progress a lot. It was not the only thing - I had different ideas about myself back, a lot of personal issues, but watching this episode right now after 15 years really hits a spot. Maybe I will return to programming :)

    • @I_hate_HANDLES
      @I_hate_HANDLES 10 หลายเดือนก่อน +1

      i wish i could watch this in my first year of university so that i would not be so frustrated debuging wrongly, now i am a little left behind🩼 but still very fun and helpful to watch

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

      Imagine if you didn't stop, you'd have 15 years of experience, and that's like senior's grandsenior, you'd be rolling in cash 💀

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

    "this all about figuring out...what did i do wrong? what did i do to deserve this?"
    im gonna be good at this

  • @ss-md4qn
    @ss-md4qn ปีที่แล้ว

    Wonderful session

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

    that's so incredible, U let me know lots of detail knowledge in C++

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

    Liked, subscribed, commented, and speeding towards the Game Engine series. Great vid, keep up the stellar work!

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

    Thank you very much for this series of video, very helpful for beginners like me. Just wonder if you could do a video about joint project of C# and C++.

  • @Andre-vn1sb
    @Andre-vn1sb 3 ปีที่แล้ว +6

    I never saw a tutorial with so deep details, so you really understand whats going on inside mashine - thank you !!

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

    Thank you once again for the awesome content!!! (your hair is amazing, dam)

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

    For XCode users:
    - Memory View : ⌘⌥⇧M or through the Debug --> Debug Workflow --> View Memory menus.
    - Autos and Locals are available by clicking on the arrow at the very bottom of the debug console.
    - To Watch a variable: Right-click on a variable and click on "watch", or right-click on the debug console and click on "add expression"

    • @sharwankumar-ci3hd
      @sharwankumar-ci3hd ปีที่แล้ว

      Could you please guide me how to debug crash program?

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

    Seeing how easy Visual Studio makes breakpoints has sold me on it.

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

    The best c++ series I found on youtube. Really inspiring

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

    Great explained!
    Many thanks!

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

    Just a point of note: You need to be in debug mode in order to open the memory window. It means you place a break point, start debugging and then go to the menu Debug -> Windows to see the Memory option. I couldn't find it and a simple search revealed this fact. When Cherno opened the memory window, he was already in the debug mode.

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

      dude you saved my life, I freaked out to do not find that memory menu option

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

      😘❣

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

    Very profound knowledge, thank you

  • @twoezy-vegito5363
    @twoezy-vegito5363 4 ปีที่แล้ว

    very helpful bro, just subscribed!

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

    this has changed everything for me

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

    Such a fun way of learning!

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

    Cherno: "If you are programming without this - I do not know what you are doing?" (@4:21)
    Me: "Everything perfectly! :) :) :)"

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

      "I use the console" would have been more realistic. Anyway he is clearly highlighting some functionalities to let you know they're there if you need them

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

    Dude, how many guitars do you possess ? x)

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

      Not enough ;)

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

      Han Solo if you have asked me that question, I would have replied "too many." Lolol. I sell guitars in my mother's shop. I wish I could learn to play guitars, yet I have never touched any guitar in my family's shop. I just never get the time for guitar tutorials.

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

      Han Solo I don't really own all the guitars in my family's shop. I was only joking in my last comment. I felt rich which I said "too many." I can write music only in my head and I would love to put that on paper or on musical instruments. I can play piano only just a little, but I don't get free time for myself. Besides I have other hobbies in the evenings and on lazy Sunday. Someday, I will get around to learning guitar or ukulele.

    • @senatorpoopypants7182
      @senatorpoopypants7182 6 ปีที่แล้ว +13

      Dude and possess don't go well in the same line

    • @rod-abreu
      @rod-abreu 3 ปีที่แล้ว

      It's never enough :D

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

    This video should be the prerequisite for introduction to programming lectures in college to understand what we are going to do . Thanks for fascinating explaining

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

    I literally took around 2.5 hours to make notes of this video. Thank you so much.

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

    Hi. Are you going to make episode about const keyword? I've been always struggling to understand why and how things can go wrong if not using them.

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

      Yep, absolutely

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

      My prof loves throw const combinations with us just to fuck with us!

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

    Thank you for this tutorial. this is very helpful.

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

    Wow this is great never knew about the memory view

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

    I already love your lessons!!!

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

    You can also CTRL+F10 and it will run to where the current line where the cursor is. Use that all the time, makes "regular" breakpoints almost useless.

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

    Great one, thank you!

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

    piano sound in background is so freaking nice

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

    fantastic explanation thanks a lot brother

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

    The only thing i wish these youtube tutorials would do, is provide some exercises for each video with an answer key (if one wants to look). I listen to the video, I am pretty sure i understand it but i guess i just need the confirmation that I have grasped the essence of what is being taught in each video. I am not complaining as i am in the beginner stages of learning so, what would i know?. Anyways, liked and subscribed.
    P.S There is something about the cool color gradients and the soft music in the background of these videos that keeps me coming back.

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

    Wow this is the best video of the basis of debuging

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

    Wow... I'm re-watching this in 2022 and it's amazing how good you are at explaining things.
    I'm blown away. Good job mate, and thank you.

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

    Hit like those who have been programming in Visual Studio for more than 2 Years and still checking this amazing video and learned a lot. U r da best Cherno :) Keep continue ur excellent effort (Y)

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

    Great video, thanks.

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

    Holy crap! mind BLOWN

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

    DAMN! No wonder people love Visual Studio so much!

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

    bucky and thecherno

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

    I am studying C++ on a 1300 pages book, currently around page 850, but being a VS feature I've never used and just discovered Breakpoints and Debug mode only thanks to Cherno. Thank you!

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

      umm can you help me with VS code like i still didn't get that where is diagnostic tools and memory window in the latest VS code IDE

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

      @@Kanak_Bodkhe I'm using VS Community, not sure if it's the same

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

      @@MicheleSollazzo yeah I realised 2 days ago that VS and VS code are different 🥲

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

    Yeeaaahhh! a new video!!!

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

    Great, helped a lot!

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

    Has the CC in the uninitialized memory location of a variable to do anything with the CC on the hoodie and the pillow?

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

    The pillow is almost perfectly aligned with the couch.

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

      Hehe, I also took notice of that

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

    thank you so much helped alot!

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

    I have never seen so many guitars in one's house before. You should do a guitar learning series!

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

    Love this series will support you , when i have some money to spare

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

    it's 2024 and I'm watching this wonderful series after 6 years, and I have no idea what Cherno is doing these days, but I hope he's doing great

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

    This was way better than i expected saying that as an experienced programmer.

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

    Youre the best. Thank you so much

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

    I like how cheerful you are goals

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

    i love this man

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

    i like the very quiet music in the background. not too loud but its still there

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

    if you can"t debug where you want just change setting of optimization(project properties->C/C++ ->Optimization-> Disable)

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

      I really appreciate your comment, I was looking for this the last two hours. Thank you so much!