Standard C++ contains several built-in exception classes, typeinfo::bad_typeid is one of them. This is an exception thrown on typeid of null pointer. Below is the syntax for the same:
Return: The typeinfo::bad_typeid returns a null terminated character that is used to identify the exception.
Note: To make use of std::bad_typeid, one should set up the appropriate try and catch blocks.
Below are the examples to understand the implementation of typeinfo::bad_typeid in a better way: