Multiple choice technology programming languages

Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b?

  1. The automatic assignment operator is used

  2. The copy constructor is used

  3. Compiler error

  4. Run-time error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In C++, if you do not explicitly define an overloaded assignment operator for a class, the compiler automatically generates a default member-wise copy assignment operator.