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

Ғылым және технология

📚 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

Пікірлер: 282

  • @CodeBeauty
    @CodeBeauty2 жыл бұрын

    📚 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

    10 ай бұрын

    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_Boo3 жыл бұрын

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

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

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

  • @spencerignatescue158

    @spencerignatescue158

    Жыл бұрын

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

  • @mr.erikchun5863

    @mr.erikchun5863

    Жыл бұрын

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

  • @OCEAN-fc9wl
    @OCEAN-fc9wl2 жыл бұрын

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

  • @alexandruteodor3585
    @alexandruteodor35853 жыл бұрын

    This tutorial is exceptional! :)

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    😁😁

  • @anonymousfan9703

    @anonymousfan9703

    2 жыл бұрын

    @@CodeBeauty I love you

  • @fachriyasir661
    @fachriyasir6613 жыл бұрын

    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:))

  • @umairawan3938
    @umairawan39383 жыл бұрын

    Saldina is a great teacher ❤️

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    Thank you UMAIR AWAN! 💜💜

  • @Javier-uh7mb

    @Javier-uh7mb

    3 жыл бұрын

    someone is in love with their teacher 🙊

  • @rudrashiva
    @rudrashiva3 жыл бұрын

    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.

  • @GhanBuri666
    @GhanBuri6662 жыл бұрын

    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!

  • @multiplier007
    @multiplier0073 жыл бұрын

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

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

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

  • @yi-chongjiang5639
    @yi-chongjiang56392 жыл бұрын

    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!

  • @carboqaddumi3944
    @carboqaddumi39442 жыл бұрын

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

  • @lukaadamovic8314
    @lukaadamovic83143 ай бұрын

    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!!!!!!!!!

  • @GlobStats
    @GlobStats2 жыл бұрын

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

  • @jasswrites3195
    @jasswrites31952 жыл бұрын

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

  • @kinghadu9611
    @kinghadu96113 жыл бұрын

    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!!!

  • @nicholasoneal1521
    @nicholasoneal15213 жыл бұрын

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

  • @lusandamtembu7383
    @lusandamtembu73837 ай бұрын

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

  • @phenhlucky
    @phenhlucky3 жыл бұрын

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

  • @manoking9619
    @manoking9619 Жыл бұрын

    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.

  • @moularaoul643
    @moularaoul6433 жыл бұрын

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

  • @zombiehellmonkeygaming1956
    @zombiehellmonkeygaming19562 жыл бұрын

    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.

  • @selenahurloi5876
    @selenahurloi58762 жыл бұрын

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

  • @denishnatiuk921
    @denishnatiuk9212 жыл бұрын

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

  • @santoshsolanke7300
    @santoshsolanke7300 Жыл бұрын

    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

  • @rosabeigi
    @rosabeigi2 жыл бұрын

    I find your content so useful

  • @marcofe82
    @marcofe822 жыл бұрын

    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.

  • @rohaannadeem914
    @rohaannadeem914 Жыл бұрын

    Your teaching way is superb

  • @waqarahmad5939
    @waqarahmad59392 жыл бұрын

    Wonderful explanation of exceptions. You made it easy.

  • @ignaciodelvalle158
    @ignaciodelvalle158 Жыл бұрын

    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.

  • @RobertSurma
    @RobertSurma Жыл бұрын

    Good diction, very clearly explained. Perfect!

  • @tiantianliu5958
    @tiantianliu59584 ай бұрын

    Great! Keep going code beauty! every interesting training.

  • @preetichaudhari319
    @preetichaudhari3193 жыл бұрын

    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!

  • @learningprogram5288
    @learningprogram52882 жыл бұрын

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

  • @nastaranhendijani681
    @nastaranhendijani6813 ай бұрын

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

  • @monilcharola6873
    @monilcharola6873 Жыл бұрын

    Thank You !! Kudos to your good work !

  • @wscamel226
    @wscamel22611 ай бұрын

    Awesome. Thank you

  • @Hiyori___
    @Hiyori___3 жыл бұрын

    Amazing teacher, thank you

  • @shubhamkalravevo1884
    @shubhamkalravevo18842 жыл бұрын

    What a fantastic explanation.!

  • @umairawan3938
    @umairawan39383 жыл бұрын

    Most awaited!!!

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    Happy to hear that! ❤️

  • @livedz9206
    @livedz92063 жыл бұрын

    Hii love from algeria❤️your teaching skills are awesome

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    Thanks and welcome! Greetings for Algeria! 💜

  • @danbrown6698
    @danbrown66982 жыл бұрын

    You've explained exception quite clear.

  • @saipranavm1468
    @saipranavm14683 жыл бұрын

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

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    Check out this playlist for Data Structures lessons. More videos are coming up. 😃💜 kzread.info/head/PL43pGnjiVwgS5njI0HMGnqSH18tSSuLz_

  • @chulbalytwins2450
    @chulbalytwins2450 Жыл бұрын

    saldina i salute your work you are so much hardworking

  • @hemersonallan
    @hemersonallan Жыл бұрын

    Awesome ! Thank You !

  • @phutrung3027
    @phutrung3027 Жыл бұрын

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

  • @user-nw5iw5ew9z
    @user-nw5iw5ew9z Жыл бұрын

    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

  • @ksprakashkumar
    @ksprakashkumar Жыл бұрын

    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.

  • @samael2187
    @samael21872 жыл бұрын

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

  • @nastaranheidarysharifabadi4648
    @nastaranheidarysharifabadi464811 ай бұрын

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

  • @senalshamika9426
    @senalshamika94262 жыл бұрын

    You are a great teacher saldina

  • @malatini_ytb
    @malatini_ytb2 жыл бұрын

    Thank you so much !!

  • @johnsknows3135
    @johnsknows3135 Жыл бұрын

    thank you kindly!

  • @4theloveoflife431
    @4theloveoflife4313 ай бұрын

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

  • @krentwhite2668
    @krentwhite26682 жыл бұрын

    this video is very useful👍

  • @jomarbombita5078
    @jomarbombita50783 жыл бұрын

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

  • @ksanavengsar4050
    @ksanavengsar4050 Жыл бұрын

    thank you so much for this video 🤗

  • @digantachaudhuri
    @digantachaudhuri3 жыл бұрын

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

  • @neeldurugkar5758
    @neeldurugkar57583 жыл бұрын

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

  • @tamarabenjamin9089
    @tamarabenjamin90893 жыл бұрын

    My favorite youtube teacher for C++.

  • @muhammetkaplan8869
    @muhammetkaplan88693 жыл бұрын

    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

  • @xaadadaa
    @xaadadaa3 жыл бұрын

    best programming channel i learned so much from u

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    I'm happy to hear that 🙏💙

  • @fKO_8004IrAn
    @fKO_8004IrAn2 жыл бұрын

    a very very good video :) thank you

  • @francescolimberti7306
    @francescolimberti73062 жыл бұрын

    Thank you!

  • @dipenpandit684
    @dipenpandit684 Жыл бұрын

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

  • @charlesmaganga8430
    @charlesmaganga8430 Жыл бұрын

    Much appreciation

  • @mrshaders5269
    @mrshaders52692 жыл бұрын

    Great Work

  • @MrNYT
    @MrNYT3 жыл бұрын

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

  • @rakshitsen5110
    @rakshitsen51103 жыл бұрын

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

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

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

  • @aleks_mag
    @aleks_mag3 жыл бұрын

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

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

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

  • @guaicaipurouzumaki7654
    @guaicaipurouzumaki7654 Жыл бұрын

    cool explain about handling errors in c++

  • @shendoo2020
    @shendoo20202 жыл бұрын

    Thank you 😊

  • @aliafzal3029
    @aliafzal30293 жыл бұрын

    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

    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*

  • @ramtodkar1681
    @ramtodkar1681 Жыл бұрын

    You have great skill explain concept 😉

  • @ahmadmahdi2245
    @ahmadmahdi22452 жыл бұрын

    Amazing!

  • @free-mind1
    @free-mind1 Жыл бұрын

    You are the best ever ❤ 👏👏

  • @KarinaGarcia-tk5re
    @KarinaGarcia-tk5re Жыл бұрын

    TE AMO ,,, THANKS FOR TEACHING C++

  • @o_o6869
    @o_o68693 жыл бұрын

    i would love to learn coding,well appreciated Saldina.

  • @amosreginaldjr.4200
    @amosreginaldjr.42003 жыл бұрын

    C++ is beautiful when you understand it!

  • @worldknowledge4969
    @worldknowledge49692 жыл бұрын

    Amazing video ,I like this video

  • @AhmedRaza-ty7zq
    @AhmedRaza-ty7zq5 ай бұрын

    Awesome video😎😎👍👍

  • @mohammadhawa337
    @mohammadhawa3373 жыл бұрын

    Thanks Saldine

  • @thangtd3010
    @thangtd30102 жыл бұрын

    thank you

  • @malikmuhammadarslan9993
    @malikmuhammadarslan9993 Жыл бұрын

    You are Such a Legend please make C# videos

  • @SHIVAMTIWARI-we9jq
    @SHIVAMTIWARI-we9jq2 жыл бұрын

    nice lecture

  • @subee128
    @subee128 Жыл бұрын

    Thanks

  • @mose999
    @mose999 Жыл бұрын

    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"

  • @alejandromackay3074
    @alejandromackay3074 Жыл бұрын

    Thanks!!!

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    👌❤️

  • @neepunpatil5201
    @neepunpatil52013 жыл бұрын

    Waiting!!!!!

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    😃💜

  • @elenibeyene2112
    @elenibeyene21122 жыл бұрын

    Amazing video i like it,,,

  • @atvuduy9238
    @atvuduy92382 жыл бұрын

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

  • @vickvolpe5967
    @vickvolpe59673 жыл бұрын

    italian subtitle, thanks 💯❤️

  • @siphelelenxumalo6147
    @siphelelenxumalo61475 ай бұрын

    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

  • @moisesnapoles2153
    @moisesnapoles21533 жыл бұрын

    GREAT! 🤩

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    Thanks! 😄

  • @aaronshrestha3694
    @aaronshrestha36943 жыл бұрын

    Thankyou

  • @khawajashams257
    @khawajashams2573 жыл бұрын

    saldina you are wonderful...

  • @hbm293
    @hbm2933 жыл бұрын

    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

    3 жыл бұрын

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

  • @ukaszkiepas57
    @ukaszkiepas572 жыл бұрын

    Thanks ;)

  • @pranitkharat621
    @pranitkharat6212 жыл бұрын

    I am from India, mam ur awesome 🙌

  • @rcookman
    @rcookman3 жыл бұрын

    exceptional!! :P

  • @CodeBeauty

    @CodeBeauty

    3 жыл бұрын

    witty :P 😃💜

  • @rcookman

    @rcookman

    3 жыл бұрын

    @@CodeBeauty Thanks :)

  • @saifmos6516
    @saifmos65162 жыл бұрын

    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

Келесі