logo

Crowdly

Browser

Додати до Chrome

Course 58

Шукаєте відповіді та рішення тестів для Course 58? Перегляньте нашу велику колекцію перевірених відповідей для Course 58 в courses.apriorit.com.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Why doesn't the catch block receive the exception, and what happens instead?

#include <iostream>
#include <stdexcept> void Foo() noexcept{    throw std::runtime_error("oops");} int main(){    try    {        Foo();    }    catch (...)    {        std::cout << "caught";    }}

0%
0%
0%
100%
Переглянути це питання
Reminder to complete the English test. Have you already taken the test?

Link: https://assessment.corporate.ef.com/public/test/d19cf15c-fc35-4d8c-8b20-75b9514e6b5d

100%
0%
Переглянути це питання

What will the program output and which C++ mechanism causes this result?What will the program output and which C++ mechanism causes this result?

#include <iostream>
 class A{public:    virtual void Foo() { std::cout << "A"; }}; class B : public A{public:    void Foo() override { std::cout << "B"; }}; int main(){    B b;    A a = b;  // !    a.Foo();}

0%
100%
0%
0%
Переглянути це питання

What value will m_val have after constructing an object of type A?

class
 A{public:    A() : m_val(42) {} private:    int m_val = 10;};

0%
0%
100%
0%
Переглянути це питання

What will the program output and which C++ feature determines this result?

#include <iostream>
 class A{public:    virtual void Foo() { std::cout << "A::Foo"; }    void Bar() { Foo(); }}; class B : public A{public:    void Foo() override { std::cout << "B::Foo"; }}; int main(){    A* obj = new B();    obj->Bar();    delete obj;}

100%
0%
0%
0%
Переглянути це питання

Which special function is called in expressions (1) and (2)?

class
 MyClass { /* ... */ }; MyClass a;MyClass b = a;  // (1)MyClass c;c = a;          // (2)

0%
0%
100%
0%
Переглянути це питання

Which overload of Foo is selected for each call and why?

#include <iostream>
 void Foo(int n)  { std::cout << "int "; }void Foo(int* p) { std::cout << "ptr "; } int main(){    Foo(NULL);    // (1)    Foo(nullptr); // (2)}

0%
0%
100%
0%
Переглянути це питання

When is variable n initialized and how many times during program execution?

#include <iostream>
 void Counter(){    static int n = 0;    std::cout << ++n << " ";} int main(){    Counter();    Counter();    Counter();}

0%
0%
100%
0%
Переглянути це питання

Which statement correctly describes the difference between these two declarations?

const
 int* p1;  // Aintconst p2;  // B

0%
0%
100%
0%
Переглянути це питання

What will the program output?

#include <iostream>
 int main(){    int x = 2147483647; // INT_MAX    std::cout << (x + 1);}

100%
0%
0%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на courses.apriorit.com?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome