C++ MQCs with Explanation (CHAPTER 6: CONSTRUCTORS AND DESTRUCTORS)

A constructor for the class Area having two data members length and breadth is declared as followsArea (int length = 15, int breadth = 10); Which one of the following object declarations is illegal?

  1. Area A(20, 10);
  2. Area A();
  3. Area A = Area (20, 10);
  4. Area A;



Answer: 
Option d: Area A;

Explanation Here

Post a Comment

0 Comments