Breakpoints and stepping through code

Breakpoints are how you pause your C++ program to temporarily stop the code from running, and have a chance to analyze and inspect your program's operation. You can peer at variables, step through code, and change variable values.

Getting ready

Breakpoints are easy to set in Visual Studio. All you have to do is press F9 on the line of code that you want operation to pause at, or click in the grey margin to the left of the line of code that you want to pause operation at. The code will pause when operation reaches the line indicated.

How to do it...

  1. Press F9 on the line you want execution to pause at. This will add a breakpoint to the code, indicated by a red dot, as shown in the screenshot below. Clicking on the ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.