From the course: Debugging C Code

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Stepping through your code

Stepping through your code - C Tutorial

From the course: Debugging C Code

Start my 1-month free trial

Stepping through your code

- [Instructor] I'm going to show you how to use the Code::Blocks debugger to debug a program as it runs line by line. And to do so, you must start a new project in Code::Blocks, console application, C language. I'm going to just title 0202, which is the title of the movie, and ensure that you're creating a debug configuration. Now open the source code file, main.c over here and select it all, delete it, and then go to this movie's exercise file, stepping1.c, 02_02-stepping1.c, select all the text, Control A, Control C to copy and then go to main C, control V to paste. Save this change, now I'm going to build and run just to see what this code does and it's really silly, it just outputs some Fibonacci numbers, but I'm going to use it to show you how to debug. Now the first thing I want to do when I debug, is set what's called a break point. A break point is where program execution will stop. So I'm going to set a break point…

Contents