Menu

[solved]-C Please Explain Code Lone Line Im Trying Understand Thank Ao Show Cc Output Following Co Q39030713

C++ please explain this code lone by line im trying tounderstand it thank you !!

….why does AO show up before CC…

What is the output of the following code? class A { public: A(){ cout << “DC” << endl; } A(const A& other) { cout<< “CC” << endl; } A& operator=(const A& other){ cout << “AO” << endl; return *this; } ~A() { cout<< “Destructor!” << endl;} }; int main() { A arr[3];arr[0] = arr[1]; A x = arr[0]; x = arr[1]; A y(arr[2]); cout<< “DONE” << endl; }

Expert Answer


Answer to C++ please explain this code lone by line im trying to understand it thank you !! ….why does AO show up before CC… W… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *