Possible Duplicate:
Can I find out the return value before returning while debugging in Visual Studio
VS get returned value in C# code?
In Visual Studio 2010, is there a way to check the value that a method is about to return? I often find myself changing code like:
return myComplexOp(someOtherComplexOp(foo));
to
var ret = myComplexOp(someOtherComplexOp(foo));
return ret;
just to make it easier to debug? Is there an easier way?
With C++ code I am stepping out of the function (Shift + F11) and open Autos window (Debug, Windows, Autos). At this point it shows recently returned value like this:
It's not the most convenient thing, but it's still something. At least you can see the returned value without altering code as mentioned in original post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With