1

Consider an example below to understand the concept of explicit constructor #include using namespace std;class person {private: unsigned int m_age; char m_gender;public: person (unsigned int age = 40, char gender = ‘M’); bool operator==(const person& other) { if ((other.m_age == m_age) && (other.m_gender == m_gender)) { return true; } return false; }};int main() { person p(40, ‘M’); person p1 = 50; //Implicit conversion if ( p == 40) { cou...

Read this post on allabouttechnologies.co.in


Karan Arora

blogs from Chandigarh