In XCode 4, when I run something like this:
string input;
cout << "Enter command" << endl;
getline(cin, input);
cout << "You entered: " << input << endl;
I see my "Enter command" prompt in the console. But when I place my mouse cursor below it and start typing the cursor doesn't move, and my keystrokes don't show up. It basically behaves like a read-only text box. What am I doing wrong? How can I interact with my program as if it were running in the terminal?
Are you pressing Return or Enter at the end of your input line?
For some keyboard the enter and return are on the same button, but if you press "shift" key, while pushing the enter/return button scanf will work.
From the site “Xcode Tools Tips”:
By the way, all I did to find that quote was to highlight your question in the browser, and select “Search” in the browser’s right click menu. It was the fourth hit in Google’s list.
I think, it’s pretty much very often a good idea to google before asking!
Cheers & hth.,
In the bottom pane of the debug window[which shows variables and their values], there is a search toolbar and a 3 option box in the upper right hand corner. Click on the middle of the three options which will display the main debug output to the right of the variable pane. The top pane is only for output. The right pane can be used to enter input.
I hope this helps. Sorry that the note is late.