logo

Crowdly

Browser

Add to Chrome

Course 58

Looking for Course 58 test answers and solutions? Browse our comprehensive collection of verified answers for Course 58 at courses.apriorit.com.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

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%
View this question
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%
View this question

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%
View this question

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%
View this question

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%
View this question

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%
View this question

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%
View this question

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%
View this question

Which statement correctly describes the difference between these two declarations?

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

0%
0%
100%
0%
View this question

What will the program output?

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

100%
0%
0%
0%
View this question

Want instant access to all verified answers on courses.apriorit.com?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome