Exception handling in C++ (How to handle errors in your program?)

Sdílet
Vložit
  • čas přidán 19. 06. 2024
  • 📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
    C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
    Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
    🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
    Experience the power of practical learning, gain career-ready skills, and start building real applications!
    This is a step-by-step course designed to take you from beginner to expert in no time!
    💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
    Use it quickly, because it will be available for a limited time.
    An exception in C++ usually represents an error (exceptional situation) that can happen during the execution of our program.
    We use exception handling in order to handle those errors that can happen during the execution of our program.
    In this video, I'll teach you how to handle errors in your program and how to work with exceptions on a real-life example.
    You'll learn about keywords that are used to work with exceptions: try, catch and throw.
    You'll also learn about different types of exception handlers and about default exception handler.
    🎁 Create Modern Apps, 5x faster, with less code, Download FREE C++Builder Trial: bit.ly/CppBuilderFree
    ☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. Use the link to make a contribution: bit.ly/CodeBeauty_BuyMeACoffee
    However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
    Contents:
    00:00 - What will you learn in this course?
    02:03 - What are exceptions
    08:36 - Throwing exceptions, throw keyword
    11:00 - Fixing application crash with try-catch, handling exceptions
    16:00 - Default exception handler
    21:13 - Summary - C ++ exceptions explained in 2 minutes
    Try building these apps:
    Quiz app - bit.ly/MyQuizAppHelp
    ATM app - bit.ly/AtmAppHelp
    To-Do list app - bit.ly/ToDoAppHelp
    Learn about classes and Object-oriented programming: bit.ly/Cpp_OOP_Playlist
    Tag me on you Instagram stories:
    Instagram 📸 - / truecodebeauty
    Twitter 🐦- / truecodebeauty
  • Věda a technologie

Komentáře • 282

  • @CodeBeauty
    @CodeBeauty  Před 2 lety +26

    📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
    C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
    Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
    🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
    Experience the power of practical learning, gain career-ready skills, and start building real applications!
    This is a step-by-step course designed to take you from beginner to expert in no time!
    💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
    Use it quickly, because it will be available for a limited time.

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

      Hi saldina, can you please share the code in your pinned comment as a github link or as a txt message it really helps before the evalution. Thank you for lessons.

  • @General_Boo
    @General_Boo Před 3 lety +42

    PLEASE never delete your channel/videos!!
    Your content is so useful

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +12

      I won't delete it. 😃 I'm hoping to reach even more people and help them learn programming. Thank you! 💜

    • @spencerignatescue158
      @spencerignatescue158 Před rokem +1

      Ah , I can't tell if your just simping or if this is meant to be sarcastic .

    • @mr.erikchun5863
      @mr.erikchun5863 Před rokem

      @@spencerignatescue158 the lonely virgin calling someone a simp. Smh

  • @OCEAN-fc9wl
    @OCEAN-fc9wl Před 2 lety +27

    This channel is perfect for learning C++ in an organic and simple way.

  • @rudrashiva
    @rudrashiva Před 3 lety +5

    I had a friend from Celic in Bosnia. You remind me of her. She is a teacher and you both have same personality. Maybe all Bosnian have same charming personality. Anyway your lessons on C++ are great for beginners.

  • @alexandruteodor3585
    @alexandruteodor3585 Před 3 lety +35

    This tutorial is exceptional! :)

  • @umairawan3938
    @umairawan3938 Před 3 lety +27

    Saldina is a great teacher ❤️

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +3

      Thank you UMAIR AWAN! 💜💜

    • @Javier-uh7mb
      @Javier-uh7mb Před 3 lety +1

      someone is in love with their teacher 🙊

  • @carboqaddumi3944
    @carboqaddumi3944 Před 2 lety +2

    this channel single-handedly carried me through my freshman computer engineering year, seriously thank you keep doing this you're great! (:

  • @fachriyasir661
    @fachriyasir661 Před 3 lety +20

    Hi Saldina, Thank you for spending your time creating video about C++. I'm not a CS student and not really good at programming but you help me pass C++ class. Now I also start to get interested to programming. I feel blessed that I found your channel, so please keep making videos like this:))

  • @GhanBuri666
    @GhanBuri666 Před 2 lety +2

    I love listening to you because you are explaining everything in the easiest possible way, but also you are speaking very clearly and have nice voice!

  • @yi-chongjiang5639
    @yi-chongjiang5639 Před 2 lety +1

    LOVEEE this video explaining everything I need in detail!!
    Also love the summary part, it goes through everything again and makes the concept more solid!!
    thank you so much!

  • @kinghadu9611
    @kinghadu9611 Před 3 lety +6

    Saldina I don't know how you get the time to do all these videos but thank you so much for all the help you have given me I am loving programming thanks to your channel.
    I think a great video you can do would be building a project like one that uses a user made form and a database etc. Any sort of real world application that one would be expected to make when in the field would be awesome!!!!
    Again thank you so much for your incredible help in sharing your knowledge. I once read a post from a wise person he said that knowledge becomes wealth if it is shared freely but it becomes a weapon when it is kept by selfish people.
    Thank you for spreading your riches and bettering humanity!!!

  • @zombiehellmonkeygaming1956

    Thank you for the video, I've learned exception handling already, but I always watch your videos in case I missed something when I first learned it, or you give a better explanation.

  • @ignaciodelvalle158
    @ignaciodelvalle158 Před rokem

    What I like about his videos is the pace and efficiency of what he explains. A discovery this channel!!
    It would be nice if you shared the code, although it is true that doing it by hand helps to understand it better.

  • @marcofe82
    @marcofe82 Před 2 lety

    Ciao Saldina, really good explanation about exceptions. I've also appreciated your slow speak, cause in this way every single words is recognizable and it's possible to totally absorb the meaning of the lesson.

  • @rakshitsen5110
    @rakshitsen5110 Před 3 lety +4

    Big fan from india🇮🇳.
    Ma'am your video help c++ language
    a lot.
    Thank you so so much.

    • @CodeBeauty
      @CodeBeauty  Před 3 lety

      Thanks for the support. Greetings to India! 🇮🇳🥰🥰

  • @ksprakashkumar
    @ksprakashkumar Před rokem +1

    Hi Saldina, Thanks a lot for your effort in teaching C++. In this example, we can add one more print and demonstrate that fourth print will not get executed when third print got an exception.

  • @GlobStats
    @GlobStats Před 2 lety +6

    I can't thank you enough, you have a great method of explaining.

  • @nicholasoneal1521
    @nicholasoneal1521 Před 3 lety +1

    Seriously, this is the best programming channel on youtube. U r awesome!

  • @manoking9619
    @manoking9619 Před rokem +2

    Your videos are so good that my professor takes your code and uses it for class lessons! Either that or you both code very similarly.

  • @santoshsolanke7300
    @santoshsolanke7300 Před rokem +1

    This channel is very perfect for learning C++ in an organic and simple way. she is teaching in very simple method
    spacially thanks, Mam for providing very helpful knowledge

  • @user-nw5iw5ew9z
    @user-nw5iw5ew9z Před rokem

    Thank you for your lessons, Saldina. You have clear English pronunciation, I like it. My English isn't so good, may be pre-intermediate level, but I understand you. Aside from programming I will study English listening with your lessons :) With love from Russia

  • @lusandamtembu7383
    @lusandamtembu7383 Před 7 měsíci +1

    yoh, you saved me when i needed you most. thank you for your easy to follow and understand videos

  • @jasswrites3195
    @jasswrites3195 Před 2 lety

    Never stop making videos, you are doing a great work!!

  • @selenahurloi5876
    @selenahurloi5876 Před 2 lety

    you are so good at explaining, i love watching your videos and hopefully i will also pass the exam!!

  • @moularaoul643
    @moularaoul643 Před 3 lety +2

    Thank you for all the time you give us!!!

  • @lukaadamovic8314
    @lukaadamovic8314 Před 3 měsíci +1

    Thank you very much Saldina. The handing of these exceptions is indeed very very VERY useful and I am truly happy that I have learned so much about this topic. Greetings from Brazil!!!!!!!!!

  • @phenhlucky
    @phenhlucky Před 3 lety +2

    Thank you for all the time that you teach us🙏❤️

  • @multiplier007
    @multiplier007 Před 3 lety +3

    You have got amazing teaching skills.
    You are the best than the teachers in university

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +1

      That is so nice to hear! Thank you very much! 💜

  • @phutrung3027
    @phutrung3027 Před rokem +1

    This tutorial is very helpful for me. By many videos like this, I can learn not only coding but also English learning skill

  • @preetichaudhari319
    @preetichaudhari319 Před 3 lety +8

    Hey Saldina!
    I would really appreciate if you can make a detailed video on Operator Overloading including topics such as Fundamentals of Operator Overloading, Restrictions on Operators Overloading, Operator Functions as
    Class Members vs. as Friend Functions, Overloading Unary Operators, Overloading Binary Operators,
    Overloading of operators using friend functions.
    Thanks!

  • @muhammetkaplan8869
    @muhammetkaplan8869 Před 3 lety

    You are a perfect detail in this world :D keep going, as a nonnative English speaker I found your speaking is very simple but at the same time understandable perfectly :D

  • @waqarahmad5939
    @waqarahmad5939 Před 2 lety +1

    Wonderful explanation of exceptions. You made it easy.

  • @learningprogram5288
    @learningprogram5288 Před 2 lety

    Awesome. this is what i have been looking for. implementation on the topic and clear explanation.

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

    Great! Keep going code beauty! every interesting training.

  • @nastaranhendijani681
    @nastaranhendijani681 Před 3 měsíci

    Thank you for your videos, I like them very much! very helpful!

  • @RobertSurma
    @RobertSurma Před rokem +1

    Good diction, very clearly explained. Perfect!

  • @samael2187
    @samael2187 Před 2 lety

    Amazing video you just helped me add exceptions to my final project thnx a lot

  • @nastaranheidarysharifabadi4648

    thank you. Im begginer in cpp and its useful for me.🥰

  • @monilcharola6873
    @monilcharola6873 Před rokem

    Thank You !! Kudos to your good work !

  • @denishnatiuk921
    @denishnatiuk921 Před 2 lety +1

    I Just couldn't grasp try catch blocks until this video thank you.

  • @rosabeigi
    @rosabeigi Před 2 lety

    I find your content so useful

  • @Hiyori___
    @Hiyori___ Před 3 lety +2

    Amazing teacher, thank you

  • @rohaannadeem914
    @rohaannadeem914 Před rokem

    Your teaching way is superb

  • @4theloveoflife431
    @4theloveoflife431 Před 3 měsíci

    Thank you sooo much. This try catch throw stuff is quite tricky if you first touch it!!,😅

  • @chulbalytwins2450
    @chulbalytwins2450 Před rokem

    saldina i salute your work you are so much hardworking

  • @danbrown6698
    @danbrown6698 Před 2 lety +1

    You've explained exception quite clear.

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

    Awesome. Thank you

  • @shubhamkalravevo1884
    @shubhamkalravevo1884 Před 2 lety +1

    What a fantastic explanation.!

  • @jomarbombita5078
    @jomarbombita5078 Před 3 lety

    Hmmp for me you are one great teacher
    So very clear and understable thanks😊

  • @dipenpandit684
    @dipenpandit684 Před rokem +1

    it's my OOP exam in 2 days this video was absolutely helpul

  • @neeldurugkar5758
    @neeldurugkar5758 Před 3 lety

    Thank you for the video, awaiting for next videos ♥️

  • @hemersonallan
    @hemersonallan Před rokem

    Awesome ! Thank You !

  • @aliafzal3029
    @aliafzal3029 Před 3 lety +2

    hey seldena.. U have busy routine but still u spend time on us like making videos for us and share your knowledge with us and i think U r amazing 🙏💜

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +3

      Thank you so much. the support that I get from this community means a lot to me! You're the best! 💜💜💜
      it's Saldina*

  • @ksanavengsar4050
    @ksanavengsar4050 Před rokem

    thank you so much for this video 🤗

  • @aleks_mag
    @aleks_mag Před 3 lety +1

    I like that your have tasks under video. So your make not just video it's very good content for learning.

    • @CodeBeauty
      @CodeBeauty  Před 3 lety

      Yep, I often include small tasks so that my viewers can use them to practice on their own as well. Thanks! 😃😃

  • @MrNYT
    @MrNYT Před 3 lety +2

    This vedio I really all the time which I want 🙏 thank mam

  • @malatini_ytb
    @malatini_ytb Před 2 lety

    Thank you so much !!

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

    Hey Saldina , thank you so much for your videos, helps all the time🥺. Could you please also do a video on code smells in c++ ,like inappropriate intimacy, data class etc. and code refactoring

  • @johnsknows3135
    @johnsknows3135 Před rokem

    thank you kindly!

  • @senalshamika9426
    @senalshamika9426 Před 2 lety +1

    You are a great teacher saldina

  • @charlesschmidt4272
    @charlesschmidt4272 Před rokem

    Very good concise introduction. Small point: there's a bug. Documents shorter than 10 characters will print without reducing the amount of available paper.

  • @fKO_8004IrAn
    @fKO_8004IrAn Před 2 lety +1

    a very very good video :) thank you

  • @tamarabenjamin9089
    @tamarabenjamin9089 Před 3 lety

    My favorite youtube teacher for C++.

  • @krentwhite2668
    @krentwhite2668 Před 2 lety +1

    this video is very useful👍

  • @francescolimberti7306
    @francescolimberti7306 Před 2 lety

    Thank you!

  • @charlesmaganga8430
    @charlesmaganga8430 Před rokem +1

    Much appreciation

  • @o_o6869
    @o_o6869 Před 3 lety

    i would love to learn coding,well appreciated Saldina.

  • @xaadadaa
    @xaadadaa Před 3 lety +2

    best programming channel i learned so much from u

  • @digantachaudhuri
    @digantachaudhuri Před 3 lety +4

    Subscriber++;
    Thanks for this video, Nice explanation.
    ❤️ from India.

  • @hbm293
    @hbm293 Před 3 lety +6

    One of the important topics in C++, especially when using the STL as almost all of its functions will throw exceptions as soon as they encounter errors.

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +3

      Indeed, it is very important topic! Thanks for your help with replying the comments in the chat today! 😃💜

  • @ramtodkar1681
    @ramtodkar1681 Před rokem

    You have great skill explain concept 😉

  • @ahmadmahdi2245
    @ahmadmahdi2245 Před 2 lety +1

    Amazing!

  • @mose999
    @mose999 Před rokem +1

    I summerize a point which may be easily overlooked:
    in 12:39 you must use "a pointer" as the parameter , so if you throw a "string type var" , you use the const char * ,because we need a pointer,however,"string" doesn't have pointer and "char" do.And string is actually a "char"

  • @guaicaipurouzumaki7654

    cool explain about handling errors in c++

  • @shendoo2020
    @shendoo2020 Před 2 lety

    Thank you 😊

  • @mrshaders5269
    @mrshaders5269 Před 2 lety +1

    Great Work

  • @amosreginaldjr.4200
    @amosreginaldjr.4200 Před 3 lety

    C++ is beautiful when you understand it!

  • @saipranavm1468
    @saipranavm1468 Před 3 lety +6

    Please do a complete course on data structures and algorithms using c++

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +5

      Check out this playlist for Data Structures lessons. More videos are coming up. 😃💜
      czcams.com/play/PL43pGnjiVwgS5njI0HMGnqSH18tSSuLz_.html

  • @malikmuhammadarslan9993

    You are Such a Legend
    please make C# videos

  • @atvuduy9238
    @atvuduy9238 Před 2 lety

    Very good. I come from VietNam. I learn both English and C++

  • @beegameplay2.082
    @beegameplay2.082 Před 3 lety

    I like your imformational videos we need some more videos about Data Structure and Algorithm and Web Development languages including some projects and i think you will helps your viewers and fans 😊

  • @saifmos6516
    @saifmos6516 Před 2 lety

    such a good video, i wonder if you could please explain us the socket and threading in c++ , also i noticed you are good at shortcuts , in your opinion what are the shortcuts that a programmer needs i saw you commenting many lines with one button and i was like oh man this could save my time so good hehe , thanks for the video

  • @KarinaGarcia-tk5re
    @KarinaGarcia-tk5re Před rokem

    TE AMO ,,, THANKS FOR TEACHING C++

  • @free-mind1
    @free-mind1 Před rokem

    You are the best ever ❤ 👏👏

  • @gvberhveh
    @gvberhveh Před 2 lety

    Great channel and videos..helping me a lot..you should cover user defined exception classes too..Pozdrav iz Hrvatske !

  • @livedz9206
    @livedz9206 Před 3 lety +6

    Hii love from algeria❤️your teaching skills are awesome

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +1

      Thanks and welcome! Greetings for Algeria! 💜

  • @mytech6779
    @mytech6779 Před 2 lety

    Super fantastic. Can you make a second video that shows how to throw and catch std::exception and std::runtime_error ?

  • @worldknowledge4969
    @worldknowledge4969 Před 2 lety +1

    Amazing video ,I like this video

  • @umairawan3938
    @umairawan3938 Před 3 lety +12

    Most awaited!!!

  • @thangtd3010
    @thangtd3010 Před 2 lety

    thank you

  • @AhmedRaza-ty7zq
    @AhmedRaza-ty7zq Před 5 měsíci +1

    Awesome video😎😎👍👍

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

    you really are amazing ma'am, keep up the great work, love from INDIA

  • @subee128
    @subee128 Před rokem

    Thanks

  • @neepunpatil5201
    @neepunpatil5201 Před 3 lety +2

    Waiting!!!!!

  • @vickvolpe5967
    @vickvolpe5967 Před 3 lety

    italian subtitle, thanks 💯❤️

  • @elenibeyene2112
    @elenibeyene2112 Před 2 lety +1

    Amazing video i like it,,,

  • @fnati02
    @fnati02 Před 7 měsíci

    hey!!
    first thank you for the video!!
    i would like to know when i use the default catch(...) how can i pass an argument to print the message?

  • @aaronshrestha3694
    @aaronshrestha3694 Před 3 lety

    Thankyou

  • @papiermuecke7626
    @papiermuecke7626 Před 2 lety +1

    I subscribed your channel because you explain so many c++ functions that i have never learned in my study! Also its very easy for me to understand everything because your english is so fluent! :-)
    It would be interresting, if it's possible to put parameters into default catch functions instead of these "...".
    Thank you very much!
    Love from Germany!

    • @CodeBeauty
      @CodeBeauty  Před 2 lety +1

      There is no need for parameters in default catch, because it will catch any unhanded exception 🤗🤗

    • @CodeBeauty
      @CodeBeauty  Před 2 lety +1

      regardless of its type 😃

  • @mohammadhawa337
    @mohammadhawa337 Před 3 lety

    Thanks Saldine