You can add adding expressions for inspection using a variety of views, including Expressions, Variables, and editor views .
You can enter any valid C/C++ expression, for example:
2 + 2
myVariable + 8
&myVariable
myClass.myMemberVar
etc.
Are all valid expressions that the Expression view can monitor and display. However, the expression cannot call a function or execute code. The following example will not work:
std:strlen("Hello");
The Add Watch Expression window (Figure 1) appears.
Figure 1 - Add Watch Expression window
The Add Watch Expression window closes and the expression appears in the Expressions view.
The Add Watch Expression window appears. Verify the expression to watch.
The Expressions view appears displaying the new expression.
The Add Watch Expression window appears. Verify the expression to watch.
The Add Watch Expression window closes and the Expressions view appears displaying the new expression.