Код: Выделить всё
for (int i = 0; i < 10; ++i) {
int x = i * 2; // I want to print x *after* this line, but before leaving the scope
}
- Setting a breakpoint on the line and using next to run: will leave the scope, cannot print x.
- using stepi: low level details seem to matter -- i don't know when to stop.
- Wait until a statement finishes executing,
- Still be inside the same scope (so local variables are alive), and
- Print a variable
Заранее!
Подробнее здесь: https://stackoverflow.com/questions/796 ... but-before
Мобильная версия