A Visual Studio expression containing a term named "by" cannot be evaluated in the viewport.

Consider my C ++ code below:

int _tmain(int argc, _TCHAR* argv[])
{
    int by = 10;
    printf("%d\n", by);

    int bx = 20;
    printf("%d\n", (by + bx));

    return 0;
}

which works great. The funniest thing is with the "by" variable. If I try to add a clock for a simple expression that contains, the result will be CXX0030: Error: expression could not be evaluated.

For example, at a breakpoint on return 0, if I add the following hours, I get the results mentioned:

by : 10
bx : 20
by + 5 : CXX0030: Error: expression cannot be evaluated
bx + 5 : 25
by + bx : CXX0030: Error: expression cannot be evaluated
(by) + bx : 30
by + (bx) : CXX0030: Error: expression cannot be evaluated
bx + (by) : CXX0014: Error: missing operrand

This happens on VS2010, VS2008 on multiple computers.

So, more out of curiosity, what happens to "by"? Is this some kind of weird operator? Why doesn't bx get the same treatment?

(I tried Google on this, but it’s pretty hard to get some relevant calls with terms like β€œby”)

+5
3

, , ++ Expression Evaluator BY. BY .

: http://msdn.microsoft.com/en-us/library/56638b75.aspx

, . , , . , , , ( ). . .

, , . , , ( ).

+7

, -. , , C/++ Assembly-Language; , , BY BYTE Assembly-Language. , Microsoft

+8

, ' :

In native C ++, debugger expressions support the following additional operators:

  • The context operator ({}) defines the context of the character. For more information, see Context Operator (C / C ++). Expressions).

  • Memory operators ( BY , WO, and DW) for accessing memory. Memory statements have the lowest priority of any statement. Memory operators are useful mainly for debugging assembly code.

+4
source

All Articles