Exception Handling | C++ Tutorial

Sdílet
Vložit
  • čas přidán 20. 06. 2024
  • How to handle exceptions in C++, where exception handling is a technique for handling unwanted or unexpected events during program execution by throwing and catching exceptions. See a list of exception type derived classes as noted in the video here: en.cppreference.com/w/cpp/err.... Source code: github.com/portfoliocourses/c.... Check out www.portfoliocourses.com to build a portfolio that will impress employers!

Komentáře • 26

  • @WicCaesar
    @WicCaesar Před 2 měsíci +11

    The first video that actually explained what was that goddamn e.

  • @AndreasAn
    @AndreasAn Před 5 měsíci +6

    Right now i am attending an advanced C++ Course at university.
    I have spent some time watching videos at youtube and most people explain exceptions while they are throwing int or strings and not objects which inherit from std::exception.
    Of course this will compile and work in smaller projects but when I need to code, there are bigger projects where I have to work with different developers. There you need to throw consistently to avoid weird crashes.
    I just wanted to mention that i watch explicitly this video as it shows catching a reference of an exception what other content creators are not doing. thanks for making serious content ^^

  • @joshisushant
    @joshisushant Před 22 dny

    The best video on exception handling for sure. Short 15 min, but covers almost everything !!

  • @programandoconian
    @programandoconian Před 8 měsíci +3

    This is the most straight forward tutorial for simple try and catch! Thanks

  • @lumguerra
    @lumguerra Před 2 měsíci +2

    Excellent video! Straight to the point, with different examples. Thank you!

  • @yigitcoban9823
    @yigitcoban9823 Před rokem +3

    Thank you Mr. Kevin. It was quite efficient video for me.

  • @lucasgroves137
    @lucasgroves137 Před rokem +6

    As always, useable information with no filler! 👍

    • @PortfolioCourses
      @PortfolioCourses  Před rokem +1

      Thank you for the positive feedback Lucas! :-)

    • @F.O.U.N.D.E.R
      @F.O.U.N.D.E.R Před 3 měsíci

      @@PortfolioCourses Thank you Mr.Kevin , love and praises from russia sir

  • @Rojfos
    @Rojfos Před 10 měsíci +1

    You've explained it really well. Link to the cpp reference was also helpful. Thanks!

    • @PortfolioCourses
      @PortfolioCourses  Před 10 měsíci

      I’m glad you enjoyed the explanation, and you’re welcome! :-)

  • @joymakerRC
    @joymakerRC Před 8 měsíci

    bro you are awesome, i watch your vids on 1.25x before and after i read the chapters. im crushing it .... many thanks

  • @AkshayRaj10
    @AkshayRaj10 Před rokem

    Thanks for making these tutorials

  • @bakeery
    @bakeery Před rokem

    Before searching i was hoping you made this video after adding chennal, the video show up, am so happy.

    • @PortfolioCourses
      @PortfolioCourses  Před rokem

      I’m glad to hear that Abubakar! :-) If you ever have ideas for topics that you think I should cover please let me know.

  • @sukritiguin5637
    @sukritiguin5637 Před rokem +2

    Great Tutorial.❤❤

  • @sabaresand7309
    @sabaresand7309 Před 5 měsíci

    Hi sir, Thanks for this useful information could you explain why you used the virtual keyword in the "what" method during the custom exception implementation.

  • @md.iqbalmahamudmoon3012
    @md.iqbalmahamudmoon3012 Před 11 měsíci

    can you make some videos about dynamic and static type casting, it would be a big help

  • @technicalmaster-mind
    @technicalmaster-mind Před měsícem

    Legend sir 🫡

  • @bachoundaseddik250
    @bachoundaseddik250 Před 26 dny +1

    dont take it the wrong way but just asking because it was funny, did the source like a "book" you've learned from exception handling had "throw 20" as an example too?

  • @badassopenpolling
    @badassopenpolling Před 4 měsíci

    Where is the sample for - Exception handling in Deleting List of objects on heap ??????

  • @dopetag
    @dopetag Před měsícem

    is `using namespace std;` not considered a bad practice?

    • @PortfolioCourses
      @PortfolioCourses  Před měsícem

      Using it in a library that is going to be re-used would be a bad practice, using it in a short program is not. This video explains why/when it is a bad practice: czcams.com/video/8gZNFt0YEZI/video.html

    • @dopetag
      @dopetag Před 27 dny

      @@PortfolioCourses thanks. I will give it a try!