logo

Crowdly

Védett-e a memóriaszivárgástól az alábbi program, ha a function() függvényben ...

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

Védett-e a memóriaszivárgástól az alábbi program, ha a function() függvényben kivétel keletkezhet, és máshol memóriát nem foglalunk?

struct Foo {

int* array;

Foo(int* array) : array(array) { }

~Foo() { delete[] array; }

};

int main() {

try {

int* ptr = new int[100];

Foo foo(ptr);

function();

} catch (...) {

std::cout << "Jaj";

}

return 0;

}

100%
0%
More questions like this

Want instant access to all verified answers on edu.vik.bme.hu?

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

Browser

Add to Chrome