Throwing multiple exceptions in c++. | Sololearn: Learn to code for FREE!

+2

Throwing multiple exceptions in c++.

How to throw multiple exception and handle them? Pls try to explain using a suitable example. I'm totally confused.

c++

11/25/2018 6:57:23 PM

Avinash Avi

6 Answers

New Answer

+3

Avinash Avi , please check below code : https://code.sololearn.com/cR1L3bz237OB/?ref=app

+4

+3

Ok Ketan I saw your code and I got the concept too but I have a query..... Is there any meaning of those integer or float values. I mean u used 100 and 23.1f so do these values make any specific sense or we can take any value?

+1

Avinash Avi it is random value I took... you can have any value...

0

Ketan can you plz explain the significance of 'f' in 1.23f

0

sai for c++ , whole numbers are treated as int by default and real numbers are treated as double by default... for example, 12 is int by default and if we need compiler to consider this as long, we write 12L... 12.3 is real number nd compiler consider it as of double datatype by default... to treat it as float number, we need to explicitly tell this to compiler by putting f at the end of value...