I think this is a silly question to ask but ... is there any way to use the constructers (overloaded or default) as the setters for a class?
here is some code:
using namespace std;
void SetNum ( int newNum );
number = 42;
number = newNum;
void thing::SetNum( int newNum )
// want to use thing(); or thing(int newNum) here
obviously this is a silly example, but I have a bigger class which has about 5 or 6 constructers, and it needs the same amount of setters ... I could just copy and paste, in fact i have done so, but I was hoping there is a way to use the constructers in setters.
Does anyone know how to do this? Is it possible?