Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between F10 and F11 keys in visual studio?

Tags:

I'm new in C#. I hit a breakpoint and pressed F10 or F11.

Which key should be use for compilation?

Please help me out. Can you explain me what this keys does?

like image 869
Siva Avatar asked Mar 23 '13 06:03

Siva


People also ask

What is the use of F11 key in Visual Studio?

The F11 key in the Microsoft Visual Studio 2005 environment activates the Step Into debug function.

How do I enable F11 in Visual Studio?

Check if you have function lock key -- 'F Lock' key on keyboard. If so then try pressing it once and then press F11 for debuging. Alternatively you can verify the working of F11 outside Visual Studio using it on IE or other windows and keying F11 , this should maximize the window. F Lock it is.

How do you step through code in Visual Studio?

Begin code stepping by selecting F10 or F11. Doing so allows you to quickly find the entry point of your app. You can then continue to press step commands to navigate through the code. Run to a specific location or function, for example, by setting a breakpoint and starting your app.


2 Answers

F10 ("step over") does not descend any further into the call stack. It moves to the next line of the current function.

F11 ("step into") drills down into the function being called.

void function1() {     function2();     function3(); } 

If you hit a breakpoint on function2(), F10 will advance to the line function3(). F11 will advance to the first line inside function2.

like image 147
j__m Avatar answered Oct 11 '22 10:10

j__m


If you are an absolute beginner with Visual Studio, say Visual Studio 2017 :

The function keys F10 and F11 helps to follow the execution path in the code and thus helps to examine the intermediate results and debug the code.

You need to put a 'break point' to any line in your own code (inside a method (function)). Before executing the program, just CLICK at the leftmost border side of the code window corresponding to a code statement from which you need to start debugging. You can put multiple break points in your code.

Now Execute(run) the program, it will come to an automatic hault at your first break point. Now keep on pressing F10 to move from one statement to another to proceed with the execution of the program (in sequential order).

But if you are currently at a statement which includes a function (method) call such as FindSum(a,b); and now if you press F11, it will take you to the fist line in the function FindSum(a,b) and proceed. Note that pressing F10 when your current statement involves a function call, it will just execute the function (without taking you to the statements in the function body) and move to the next line in your code.

In short, pressing F11 will take you to every line including your function body, but F10 allows to move from one line to the the immediate next line.

like image 39
Biju Joseph Avatar answered Oct 11 '22 11:10

Biju Joseph