Q:

Which among following is correct for initializing the class below?

0

Which among following is correct for initializing the class below?

class student{
int marks;
int cgpa;
public: student(int i, int  j){
marks=I;
cgpa=j
}
};

  1. student s[3]={ s(394, 9); s(394, 9); s(394,9); };
  2. student s[2]={ s(394,9), s(222,5) };
  3. student s[2]={ s1(392,9), s2(222,5) };
  4. student s[2]={ s[392,9], s2[222,5] };

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

 (b).student s[2]={ s(394,9), s(222,5) };

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

OBJECT ORIENTED PROGRAMMING OOPS CONCEPT AND FEATURES MCQ

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Object can’t be used with pointers because they ... >>
<< Which among the following is correct?...