Question:In the given sample Code, is the constructor definition valid?
class someclass
{
   int var1, var2;
   public:
      someclass(int num1, int num2) : var1(num1), var2(num2)
      {
      }
};
 

A Yes, it is valid 

B No, we cannot assign values like this 

C No, the parenthesis cannot be empty 

D No, the parenthesis cannot be empty 

+ Answer
+ Report
Total Preview: 17851

Copyright © 2024. Powered by Intellect Software Ltd