## Adding Expressions

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");

#### Adding Expressions

- In the Expressions view

1. Right-click in the Expressions view and select Add Watch Expression

The Add Watch Expression window (Figure 1) appears.

Figure 1 - Add Watch Expression window

2. Enter the expression to watch in the Add Watch Expression window
3. Click OK

The Add Watch Expression window closes and the expression appears in the Expressions view.

- In the Variables view

1. Right-click a variable in the Variables view to open a context menu
2. Select Watch

The Add Watch Expression window appears. Verify the expression to watch.

3. Click OK

The Expressions view appears displaying the new expression.

- In an editor view

1. Right-click a variable in the source file to open the context menu
2. Select Add Watch Expression...

The Add Watch Expression window appears. Verify the expression to watch.

3. Click OK

The Add Watch Expression window closes and the Expressions view appears displaying the new expression.

##### Related tasks

- Editing Expressions
- Removing Expressions

##### Related references

- Expressions View