logo

Crowdly

#include <iostream>   using namespace std;   class A{   public:      ...

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

#include <iostream>  

using namespace std;  

class A{  

public:  

    A(){  

        cout<<"Constructor called\n";  

       }  

    ~A(){  

        cout<<"Destructor called\n";  

        }   

};  

int main(int argc, char const *argv[])  

{  

    A *a = new A[5];  

    delete[] a;  

    return 0;  

}  

  1. Segmentation failure.
  2. Error.
  3. The Constructor will be invoked five times, and after that destructor will be invoked only once.
  4. The Constructor will be invoked five times, and after that destructor will also be invoked five times.

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

Want instant access to all verified answers on moovit.vit.ac.in?

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