However, I mean when you "stepped into the scope" the watch still displays wrong number. i.e.when stepped on function "int lol()" call, it's wrong number, when stepped on ++k, it still wrong number, so does k =34; std::cout << k;.........well but the "cout" still produce the correct result. That's why I suspect the watch is broken in some way.....
Nah, it's not a bug. ^^
++k is resolved after the debugger stopped there, that's the reason why it shows the false number.
If you would put a breakpoint the line after, it should show correct output.
You'll find the same behaviour in Microsofts Visual Studio, if I remember right.
again, thx for reply.
Well, it doesn't. If you put a breakpoint at int main() or {, in MSVC 2005 EE, the locale watch doen't even show the variable k util you stepped in the scope, it will display the random number before the variable initialization statment, and after the initialization, it works fine. If you force put on a watch manually it will say "CXX0069: Error: variable needs stack frame" before the scope.
If it is not a "bug", at least the IDE should stop user putting a breakpoint at main() or {.