In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what is the method of debugging codeblocks, the article is very detailed, has a certain reference value, interested friends must read it!
How to debug codeblocks? The following article will introduce you. There is a certain reference value, friends in need can refer to, hope to help you.
CodeBlocks is an open source, full-featured, cross-platform integrated development environment (IDE).
Download address: http://www.codeblocks.org/downloads/26
Among them, the installation package installer can be used in Windows environment, or the installation-free zip can be used.
Functions of the CodeBlocks Debugger
In general, the debugger is an indispensable tool in IDE.
The debugger plays a very convenient role in tracking code execution and locating bug.
Although it is said that we can not rely too much on the debugger, in general, especially the program logic is complex, the use of debugger can greatly improve the efficiency of program optimization and maintenance.
How to debug CodeBlocks?
The CodeBlocks debugger requires a complete project to start, and the debugger cannot be used by separate files. Using the debugger, the project you create is preferably in an English path, which cannot contain Chinese characters.
1. Create a project
1), create a project when or after CodeBlocks starts
2), console program selection
3), fill in the project name and path
4) Select a compiler, which is fine by default
5) after the project is created as follows, you can write a program in the automatically created main.cpp, or create a new file
2. Start the debugger
1) in general, the debugger button can be found in the toolbar
If not, you can call it from the view menu item
2), set breakpoint
When using the debugger, you need to let the program interrupt where you want. Set the breakpoint before starting the debugger as follows. Click on the left side of the editor to set the breakpoint.
3), start the debugger
The debugger needs to be launched in Debug mode, click the button debug:
After startup, when the program executes to the breakpoint, it interrupts
If you encounter an input statement during execution, you need to complete the input before you can continue execution
Open the debug window in the toolbar, mainly opening Watches
What is displayed in Watches is the value of the current variable, and you can expand the array
In addition to the automatically displayed values, you can also manually add variables that need to be observed, such as a value in the array
Click Next line to execute the next statement, the right side of the Step into to execute the internal statement, the rightmost red button Stop debugger to end debugging; when the function call is executed, you can use next line to directly execute the function, or step into to jump to the function to execute the statement. If you want to stop debugging, click stop debugger
End
The above is the basic use of the debugger, the main purpose of debugging is to track the value of the variable, to observe whether the program is executing as expected, and if the value of the variable does not match the expectation, the problem occurs in the previous statement.
Before debugging, you need to consider a code snippet that may have problems, and set a breakpoint after this code snippet.
The above is all the content of debugging codeblocks method, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.