What is different between f10 and f11 button during breakpoint debugging in Visual Studio? [Resolved]

Posted by Kumarkrishna184 under .NET Framework on 12/4/2015 | Points: 10 | Views : 6850 | Status : [Member] | Replies : 2
What is different between f10 and f11 button during breakpoint debugging in Visual Studio?

Thanks and Regards,
Krishna Kumar



Responses

Posted by: Rajnilari2015 on: 12/4/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
F10 ->Step Over
F11->Step Into


F10 (or Step Over)
-----------------------

Performing a step over the function ; not entering into the detail of the function. In other words , we are skipping the detail and moving onto the next line.

F11 (or Step into)
--------------------

Entering into the details of the called function.

An example. Suppose we have the below code piece

using System;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var add = AddFunction(10,20);
Console.WriteLine(add);
Console.ReadKey();
}

static int AddFunction(int a,int b)
{
return a+b;
}
}
}


Now set a break-point at the var add = AddFunction(10,20);

If we perform a Step Over(or F10), then after that line, the control will go to the next line which is Console.WriteLine(add); followed by Console.ReadKey(); and lastly } and finally returns a value of 0 to OS.

If we perform a Step Into (or F11), then after var add = AddFunction(10,20); , the control will go into the called function implementation of AddFunciton which is return a+b and after that Console.WriteLine(add); and so on.

Hope this will be helpful.

--
Thanks & Regards,
RNA Team

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kumarkrishna184 on: 12/4/2015 [Member] Starter | Points: 25

Up
0
Down
Thanks alot sir, now i am very clear

Thanks and Regards,
Krishna Kumar

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response