logo

Crowdly

Dado el siguiente programa, ¿qué afirmación es cierta? 1 #include <iostream...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Dado el siguiente programa, ¿qué afirmación es cierta?

1#include <iostream>

 

2class test {

3public:

4 class Fallo{};

5 test(bool b) noexcept : b_{b} {}

6 ~test() noexcept(false) { if (!b_) throw Fallo(); }

7 void func() { if (!b_) throw Fallo(); }

8private:

9 bool b_;

10};

 

11int main() try

12{

13 test t(false);

14 t.func();

15 std::cout << "Fin del programa" << std::endl;

16} catch (const test::Fallo& ex) {

17 std::cerr << "Fallo detectado" << std::endl;

18}

0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on av03-24-25.uca.es?

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