I have a function that I call recursively, but I want to keep track of a maximum through the entire process.
This is what I am doing:
void Intersect(double &MaxDistance)
{
if(something)
MaxDistance = something;
Intersect(MaxDistance);
}
Is that correct/reasonable? Something doesn't seem to be working and I'm having a hard time debugging because it's recursive (and I've rarely dealt with recursive functions).
Any suggestions?
Thanks,
Dave