What is the method of program debugging and memory detection in CAccord +?
This article mainly talks about "what is the method of program debugging and memory detection". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the method of program debugging and memory detection"?
1. Common debugging skills
(1) check the code, reread the program and rule out obvious errors. Compile with the-Wall parameter to generate all warnings.
Gcc-Wall-pedantic-ansi means to generate all warning messages in ansi/iso.
(2) sampling: add some code to the program to collect more information related to the behavior of the program when it is running. Using conditional compilation, you can clearly identify what is debug code, which is conducive to the finishing of the code after debugging.
For example:
# ifdef DEBUG
Std::cout