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.

Examining variables and memory

Examining variables and memory - C Tutorial

From the course: Debugging C Code

Start my 1-month free trial

Examining variables and memory

- [Instructor] I've started a new Code::Blocks project with a debug release and pasted in the source code file from exercise file 02_03/var1.c into the main source code right here. I'm going to set a break point at line eight, right before that while loop, and run to that point. From the debugging toolbar, show the Watches window, which lets me examine variables in the code. And here you see the two variables. Integer x and the array string. As I step through the code, see what happens to the value of variable x as it increments. And in the output window, the string slowly appears. I'm going to add another variable, string array element x. And you see its value and character, and I'm going to continue to step so that you can see how these values change. This happens all the way until the null character is encountered at the end of the string. There's the null character. And the code is done, so I'll just go ahead and…

Contents