hello, I've got one class constructor with two option parameter; so I can create the object like this:
Myobj::Myobj( char* parone="", char* partwo="") :
_name(parone), _value(partwo) {........}
Myobj obj(); // in this case warning
Myobj obj("one", "two"); //this ok.
//warning is: prototyped function not called (was a variable definition intended?)
Myobj::Myobj( char* parone="", char* partwo="") :
_name(parone), _value(partwo) {........}
Myobj obj(); // in this case warning
Myobj obj("one", "two"); //this ok.
//warning is: prototyped function not called (was a variable definition intended?)
To copy to clipboard, switch view to plain text mode
I suppose that to using default parameters is necessary has first parameters not default. Is this? Anyway: I'd like avoid a second constructor because I had to duplicate its contents (and It could be large). Ideas?
THanks..
Bookmarks