pythontutor-dev / pythontutor

10 stars 4 forks source link

cout in function call prints all output to trace right away and "skips" tracing the call #9

Open pgbovine opened 5 years ago

pgbovine commented 5 years ago

example:

#include <iostream>
// prints ALL output to trace even before this function gets traced
// but doesn't exhibit this behavior when loop code is INLINED into main
void myLoop() {
  for (int i = 0; i < 5; i++) {
     std::cout << "stuff " << i << std::endl;
  }

}

int main() {
  myLoop();
  return 0;
}