sesame.seed2
sesame.seed2
question about operator bool() const
when checking if an object has valid data do we need to check every private member of the class or only one? For example:
class Student {
int no;
float grade[NG];
int ng;
class Student {
int no;
float grade[NG];
int ng;
In the OOP notes the conversion operator for bool only checks that one member is not zero or true Like this: Student::operator bool() const { return no != 0; } Long story short do we need to check every member is true or only one for it to be considered valid data in an object?
9 replies
can anyone explain to me why this is wrong?
25 replies
function return..
4 replies
Help nullptr
70 replies