如何在Visual Studio中进行调试时知道函数的返回值 [英] How to know function return value during debugging in visual studio
本文介绍了如何在Visual Studio中进行调试时知道函数的返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道在调试过程中不将FunctionY的返回值分配给变量的情况吗?
I want to know returning value of FunctionY without assigning it to variable during debugging is it possible ???
public string FunctionX()
{
return FunctionY("some parameter");
}
public bool MainFunction()
{
if (FunctionX() == "Value")
return true;
else
return false;
}
推荐答案
在return语句上放置一个断点.
一旦代码在断点处停止,只需将鼠标悬停在执行后的Function()上,您将获得该值.
Put a breakpoint on the return statements.
Once the code stops on the breakpoints, just hover your mouse over Function() after it has executed and you will get the value.
1.在函数X的开始处放置断点/> 2.选择带有参数的FunctionY
3.右键单击
4.单击快速监视"
1.Put Breakpoint at the starting of the functionX
2. Select FunctionY with parameters
3. right click
4. click on Quick Watch
这篇关于如何在Visual Studio中进行调试时知道函数的返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文