hi, I need 2 members similar:
but it contain 100 lines. Do I have to repeat the entire body of member twice? another way? thanksQt Code:
void ob::Write(QTextStream& xstrm)To copy to clipboard, switch view to plain text mode
hi, I need 2 members similar:
but it contain 100 lines. Do I have to repeat the entire body of member twice? another way? thanksQt Code:
void ob::Write(QTextStream& xstrm)To copy to clipboard, switch view to plain text mode
Regards
You can use the default value and implement only one of the methods:
Qt Code:
if(pd==0){ // no second parameter, act accordingly } }To copy to clipboard, switch view to plain text mode
Either that, or you can place the code common to both functions in a third (private) function and call it from both. Personally, I prefer it that way.
"The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry
Bookmarks