A simple example, VS2019 debugging C language program

First of all here to talk about small series using Visual Studio environment, but you are a registered account to log in the following figure 2019 Community Edition Community Edition is free to use, otherwise it will fail to detect license after 30 days.
Here Insert Picture Description
Here Insert Picture Description

In the previous example of a simple C program methods to create C projects have been posted detailed shots, still do not understand this piece of old iron content can view the article to understand the next herein, this no longer introduced to create a project the process was. We began to introduce direct this content, look at a simple code, the following
Here Insert Picture Description
is not very easy to use them, to guess the outcome num is the number? I believe we all have guessed.
Here Insert Picture Description
Followed by this simple example to introduce debug method, first of all, to add a breakpoint in the program, will stop at the breakpoint when this program is executed, no side program instantly execute finished. Add breakpoints as follows, click the left mouse button in the red box area appears red dot (break).
Here Insert Picture Description
Down in the menu bar click Debug or directly using shortcut keys F5
Here Insert Picture Description
Debug screen is as follows:

Here Insert Picture Description
Let down step by step implementation of the program, click on the single-step execution (F10), enter the function (F11), out of a function (shift + F11), the next breakpoint (F5)
Here Insert Picture Description
during program execution, you can see the status of each variable, as follows
Here Insert Picture Description

Well, the simple debug introduced here, we can start to practice, described later complex example.

If you think this article helpful to you, please forward it to more people

[ C language Chinese community ] is a C language video tutorial, learn dry knowledge focused on C programming language learners' notes, e-books, two computers and other information-sharing platform, featuring in-depth articles, share his dry goods category, class skills learning resources to help you study.
Here Insert Picture Description

Published 37 original articles · won praise 64 · views 30000 +

Guess you like

Origin blog.csdn.net/csdn_wangchong/article/details/103550415