What will be the output of the following C++ code? #include <iostream> using namespace std; class A{ public: A(){ cout<<"Constructor called "; } ~A(){ cout<<"Destructor called "; } }; int main(int argc, char const *argv[]) { A *a = new A[5]; delete a; return 0; }
1.Constructor called five times and then Destructor called five times
2.Constructor called five times and then Destructor called once
3.Error
4. Segmentation fault
Posted Date:-2021-01-31 14:08:04