Suppose I have a function:

double Rec(double x, int n) { if(n < 0) { x = 1.0 / x; n = -n; } if (n > 0) { return x*Rec(x, n - 1); } else return 1.0; } int main() { double x = 2.0; for (int index = -3; index <= 3; ++index) cout << x << "in two == " << Rec(x, index) << endl; } 

How to see in the debugger how it works step by step?

I launch the debugger, it works only in the main() function and does not show what happens in the Rec() function.

  • 3
    Make sure you build the program under Debug, and use the Step Into steps. Also in the debugging process in the context menu (right-click) there is a choice of which function to enter - when there are several of them in the line. - nzeemin 8:52 pm
  • @nzeemin Thank you, everything turned out - user211771

1 answer 1

From the comment by @nzeemin :

Make sure you build the program under Debug , and use the Step Into steps. Also in the debugging process in the context menu (right-click) there is a choice of which function to enter when there are several of them in the line.