Loading practice questions
Which exception is thrown if the typecasting is not done properly?
Correct Answer: B — bad_any_cast
Explanation:
bad_any_cast exception is thrown when typecasting is not done properly by the user i.e. if any is storing int value and we are trying to cast it into a string then the program will throw bad_any_cast exception.