C++ Tutorial/Exceptions/standard exceptions

Материал из C\C++ эксперт
Перейти к: навигация, поиск

standard exceptions

<source lang="cpp">#include <iostream.h>

  1. include <exception>
  2. include <typeinfo>

class A {}; int main () {

 try {
   A * a = NULL;
   typeid (*a);
 }
 catch (std::exception& e)
 {
   cout << "Exception: " << e.what();
 }
 return 0;

}</source>