Exception Handling in c++ | Part-2/3 | Try, Catch & Throw | OOPs in C++ | Lec-47 | Bhanu Priya
HTML-код
- Опубликовано: 8 сен 2024
- what is the use of try, catch and throw keywords, how to construct the try and catch block, how to throw an exception in detail with example.
Please Like, share and subscribe: / @education4uofficial
for more related videos
Thanks a lot
some corrections in program--
#include
using namespace std;
int main()
{
int a=10, b=0, c;
try
{
if (b==0)
throw "division by zero is not possible";
c=a/b;
}
catch (char const*Excp)
{
cout
What is the correction?
yeah char const is right
Why you using char const?
great method madam
Good one.. better to explain with practical example by excute
Tq mam
Mam why we can use using namespace in cpp...
here division by sero is not possible is not displayed in output
Are you a lecture
stop watching from 10:10 whole code error ..mam pls check before u post
here's the corrected program
#include
using namespace std;
int main()
{
int a=10,b=0,c;
try{
if(b==0)
{
throw "impossible";
c=a/b;
}
}
catch(char const*ex)
{
cout