G
Guest
OK I know a constructor can't have a return value but is it feasible such that I have a class whereby
//in MyClass1.
class MyClass
MyClass1(){}
~MyClass1(){}
MyClass1(int & Result) {Result = InitMyClass()}
int InitMyClass()
//in main.cp
int main(
int result
MyClass theobject(result)
printf("The result of initializing the class is %d", result)
//in MyClass1.
class MyClass
MyClass1(){}
~MyClass1(){}
MyClass1(int & Result) {Result = InitMyClass()}
int InitMyClass()
//in main.cp
int main(
int result
MyClass theobject(result)
printf("The result of initializing the class is %d", result)