My friends are keep telling me "Use debugg idiot !"

I found out that for a code over 200 lines is very important.
But i want to debug only a specific piece of code.
And to review the results of a variable while the code is "executing" .

Is this possible ??

Is there anybody that can show me step by step (using snapshots from his computer for example) how to do this ? I searched over the internet but all the turorials didn't work for me cause of my bad english skills.
Iam using wxDev C++ for writing code in C :-)
Thanks in advance...

Recommended Answers

All 3 Replies

Well on a normal linux machine, it comes with a command called gdb (or you may have to install it) but you just compile your code with gcc -g -o <name> <name>.c and then gdb ./<name> you will then be in the gdb console, where you can use list <linenumber> to view the code you compiled along with the linenumbers alongside. Then type break <linenum> and you can make the program pause when it reaches the line, and return the focus to the console. You can then type things like print <varible> and it will tell you what the value of the varible is. Then you can step through the program line by line with next or continue the program from where you used break with continue and to end the debugger, just type quit

There is also a gdb for windows, try this (I haven't used it before though)

I mean debugging on your code.

Is this the same that you have posted ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.