✅ 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;}