Hey,
I write a simple console c++ program on XCODE fro mac.
The code is very simple
#include <iostream>
using namespace std;
int main() {
int a = 0;
cin >> a;
return 0;
}
Then,
1: Press command + R to debug the program.
2: The program is waiting for user input, don't input.
3: Put a breakpoint at "return 0;"
4: The program will continuing running and hit the breakpoint which was put in step.3 without input anything.
As I didn't input anything besides put a breakpoint, the "cin >> a;" should still block the program and waiting for user input. So the actual behavior is not expected.
Have any idea?
Thanks
2
0
517