Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iMacFarlane

macrumors 65816
Original poster
Apr 5, 2012
1,123
30
Adrift in a sea of possibilities
I'm taking a C++ class for college, and have been using XCode as my compiler. We are writing simple programs using the terminal for output, mainly cout and cin commands.

Thing is, after I updated to the new XCode yesterday, all my programs that use cin have a new, strange behaviour. When I enter whatever is needed into the program at runtime, the terminal only echoes the first character I pressed. The cin function actually receives the entirety of my input string, but I'm typing blind. All the programs still work just fine, but what gives with the terminal not echoing characters as I type during a call to cin?

Anyone else seen this or can reproduce?
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
I saw a discussion about this issue on Apple's paid developer forums. Apple's Xcode engineers are looking into this issue, but there's no fix yet.
 

mabeyman

macrumors member
Sep 21, 2012
30
0
Hey im in college too and have been using Xcode and I am experiencing the exact same thing. Very frustrating. I exported the .cpp to Visual Studio and the code worked fine so its something with Xcode. Glad im not the only one having problems
 

robvas

macrumors 68040
Mar 29, 2009
3,240
629
USA
Hey im in college too and have been using Xcode and I am experiencing the exact same thing. Very frustrating. I exported the .cpp to Visual Studio and the code worked fine so its something with Xcode. Glad im not the only one having problems

Run your programs from the Terminal
 

iMacFarlane

macrumors 65816
Original poster
Apr 5, 2012
1,123
30
Adrift in a sea of possibilities
There's nothing to reproduce if you don't post any code.

The problem seemed so simple and universal it didn't even occur to me to post any, but this'll do:

Code:
#include <iostream>
using namespace std;

int main()
{
    int number;
    
    cout << "Type a number between 10 and 10000\n";
    cin >> number;
    cout << "See how I only echoed the first digit?\nI WAS listening, and actually stored " << number << endl;
}
 

firewood

macrumors G3
Jul 29, 2003
8,113
1,351
Silicon Valley
I control click on the Xcode Products result in the File Navigator, select Show in Finder, then double-click the executable's icon. Runs the command-line app in a Terminal Window, which is much more configurable.

But debugging is a pain.
 

iMacFarlane

macrumors 65816
Original poster
Apr 5, 2012
1,123
30
Adrift in a sea of possibilities
Well, it looks like Apple's rolling out the update to fix Xcode. This problem was actually the top of their corrections list, the rest of the list is pretty minor stuff. Wow, Apple, really? 1.61GB to fix a text printing problem? Over one and a half trillion bytes to squeeze in that fix? One greek letter for you - Delta.
 

robvas

macrumors 68040
Mar 29, 2009
3,240
629
USA
Well, it looks like Apple's rolling out the update to fix Xcode. This problem was actually the top of their corrections list, the rest of the list is pretty minor stuff. Wow, Apple, really? 1.61GB to fix a text printing problem? Over one and a half trillion bytes to squeeze in that fix? One greek letter for you - Delta.

71.94MB

PjMHI.png
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.