![]() |
|
#1
|
|||
|
|||
Tips for effective debugging in C++hi all,
am beginner for c++ environment. i need to debug de c++ code stuffs . so need some help and tips for effective debugging for fixing bugs am supposed to use Microsoft Visual Studio |
|||
|
#2
|
|||
|
|||
Re: need tips for effective debugging in c++I believe MSVS has built-in debugging tools. Any reason you cant use them?
|
|
#3
|
|||
|
|||
Re: need tips for effective debugging in c++okey thanks .
is there any other alternative for debugging |
|
#4
|
|||
|
|||
Re: need tips for effective debugging in c++Well placed cout/cerr/ofstream object calls. Can be pretty handy as sometimes Visual Studio's debugger limits the scope of variables you need to know the value of, but a real pain to insert and remove.
|
|
#5
|
|||
|
|||
Re: need tips for effective debugging in c++If you are going to use tracer bullets (output statements for debugging) you may as well design them so they can be turned off at compilation (or by internal flag)
CPP / C++ / C Code:
Internal flag example CPP / C++ / C Code:
I used C examples above as it makes the example easier, but you can derive equivalent methods in C++ that accomplish the same. |
|
#6
|
|||
|
|||
Re: Tips for effective debugging in C++Quote:
As for generalized debugging techniques, yes, the brute force method many will advocate is by integrating printf() statements in one form or another, however this can adversely affect performance if the purpose of the code is time-critical. Fundamentally, nothing replaces knowledge of the problem space. If you have prior experience debugging code & debugging code related to the problem at hand, you will be able to more effectively & efficiently track down errors. Yet in the absense of domain-specific knowledge:
Lastly, experience helps. The more you debug, the better you will become at the skill. Learning to debug your own code is a beginning, but learning how to debug other people's code is more important as you have to figure out how they understood the problem & implemented their solution. |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Google AdSense tips to earn money | amigo | AdSense Forum | 30 | 17-Mar-2008 09:02 |
| I/O array problem with data files | Mr_Peepers | C++ Forum | 8 | 21-Feb-2008 19:22 |
| 4 Tips to Find the Web Host That's Right for You | abdellah2d | Web Hosting Advertisements & Offers | 1 | 11-Aug-2007 10:36 |
| Memory de-allocation during debugging | gaoanyu | C Programming Language | 12 | 19-Dec-2005 04:50 |
| Royalty Free Music Tips | abacomedia | Music Forum | 0 | 26-Jul-2004 14:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The