A Constructor is called when you are making a new instance of a class and member functions are functions that you can call within your class or else call using the instance of that class.
for example
class Foo {
public:
int bar;
Foo(int bar) {this->bar = bar;}
inc_bar(); {this->bar++;}
};
Foo instance(10); // Constructor is called and bar is set to 10
cout << instance.bar << endl;
instance.inc_bar(); // call the member function to increment bar
cout << instance.bar << endl;
Copyright © 2026 eLLeNow.com All Rights Reserved.