Evaluating a C or C++ Expression
See Also
When you are in a debugging session, you can evaluate any
expression to view the values of local variables in the current
context.
To evaluate an expression:
-
Start a debugging session.
-
Choose Run > Evaluate Expression (Ctrl-F9) from the main window.
-
Type the expression in the Expression drop-down and click Evaluate.
The result is shown in the Results window.
You can set a watch for the expression by clicking the Watch button.
The watch is added to the Watches window.
Notes:
-
If you evaluate a method that changes a global variable, the
global variable's value is changed in the debugging session as well.
-
If you try to evaluate a variable that is outside the scope of the
current function, the IDE says "variable" is not a known variable in
current context.
-
If you try to access a global variable before the class that
contains the variable is instantiated, the IDE says Cannot access
instance variable "variable" from static context.
Legal Notices