A
Alfonso Morra
If one wants to pass default arguments to a constructor, what is the
best way to do it, (other than overloading the constructor and writing a
helper function)?
MyClass MyClass(int, int);
MyClass MyClass(int,int,float) ;
void helper_func(int,int, float = PI) ;
I mean is there anyway one can write something like this :
MyClass c* = new MyClass(int arg1, int arg2, float arg3 = PI) ?
(AFAIK, this is illegal, as the compiler dosen't grok it.
Tks
best way to do it, (other than overloading the constructor and writing a
helper function)?
MyClass MyClass(int, int);
MyClass MyClass(int,int,float) ;
void helper_func(int,int, float = PI) ;
I mean is there anyway one can write something like this :
MyClass c* = new MyClass(int arg1, int arg2, float arg3 = PI) ?
(AFAIK, this is illegal, as the compiler dosen't grok it.
Tks