C++
What excep ...
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
What exception is thrown if a null pointer is passed to the typeid operator as an argument?
std::bad_typeid
std::bad_alloc
std::bad_function_call
std::bad_weak_ptr
std::bad_exception
Explanation
Get an explanation when it's available:
Subscribe
pointers
exceptions
typeid
NULL
Like
Login in
to like
Comment
Login in
to comment
Share
Tweet
Related Content
Каков будет вывод следующего кода? #include <iostream> using namespace std; class Zero{}; class One: public Zero{}; class Two: public Zero{}; int main() { One* pO = new One; Two* pT = new Two; cout << (typeid(pO) == typeid(pT)) << endl; return 0; }
К чему приведет выполнение следующего кода? class A { public: void print(const char* buf) { cout << buf << endl; } }; int main() { ((A*)0)->print("Test"); return 0; }
Что будет выведено на экран? #include <iostream> using namespace std; struct A {}; struct B: A {}; struct C: B {}; int main() { try { throw new C(); } catch(void *) { cout<<0; } catch(A*) { cout<<1; } catch(B*) { cout<<2; } catch(...) { cout<<3; } }
Что выведет программа: #include <iostream> struct B { void PrintIt() { std::cout << "Does it work?" << std::endl; } }; int main() { B *obj = NULL; obj->PrintIt(); return 0; }
int main() { const int* i = int(); // 1 int const* j = int(); //2 int* const k = int(); //3 int* l(); //4 ++i; //5 ++j; //6 ++k; //7 ++*k; //8 ++l; //9 } Откомпилируется ли такой код? Если нет, то в каких строчках будут ошибки компиляции? После стандарта C++14.
C
++
Quiz
Login to learn C++
or
Read more about
C++ Quizzes
Follow CodeGalaxy
Mobile Beta
Send Feedback
Keep exploring
C++ quizzes
Какой результат работы программы? #include <iostream> using namespace std; void f(double) { cout<<"f1"<<endl; } void f(const int ) { cout<<"f2"<<endl; } void f( int & ) { cout<<"f3"<<endl; } void main(void) { int n = 1; double b = 2; f(n); f(b); }
#include <iostream> using namespace std; int &test() { static int a = 3; return a; } int main() { ++++++test(); cout << test() << endl; return 0; } Что выведет cout?
При истинности какого из приведенных высказываний имеет смысл вычитание указателей?
Какое ключевое слово используется для описания пространства имен?
В чем разница между X x; и X x(); ?
Скомпилируется ли этот код: struct A : int { };
Sign Up Now
or
Subscribe for future quizzes
Login in to like
Login in to comment