i have two functions, like:
double FuncAA(string StrVar, int IntVar) //old function
//lots of code lines
double FuncBB(string StrVar, int IntVar, bool IsNewVar) //new function
//same code lines in FuncAA
if(IsNewVar == true)
the most easy way is to Copy all codes in FuncAA and paste in FuncBB,
but i think it is a studpid way and will by hard to maintain in the future.
if i need to change some codes in FuncAA, i need to change the same thing in FuncBB.
so i think i need to use some kind of inherit/overload to do it.
i checked the method.
i know i can use "class A : class B" to let classA inherit B
but can i do it in two functions?
or what is the better way to do it?
View Complete Post