Consider the two code segments below. Which one is better and Why? If you have any other idea, please do mention. Where can I find answers to coding p
A switch would be a better solution to your problem I think. You would need to overload the method to take in an int param and I don't know if that's something you would want to do or not.
Bool MyApplication::ReportGenerator::GenerateReport(int i)
{
switch(i)
{
case 1:
// do something
break;
case 2:
// do something
break;
// etc
}
return GeneratReport()
}
Not really sure what your plan is since you're calling the method recursively and as some point you will want to leave the method.