Xcode 8.3 c++ issues using cout and cin on same line

When using Cin imediately after a cout, there seems to be some issues when building and using the debug terminal.


#include <iostream>

int main(int argc, const char * argv[]) {
    // insert code here...
    int num;
    std::cout << "Testing: ";
    std::cin >> num;
    std::cout << "input was " << num << std::endl;

    return 0;
}


Using the above code as a test case, one would expect the output to be:


Testing: <wait for input>


------


Testing: 12
input was 12

------


However the actual terminal input and output runs as such:


12
Testing: input was 12
Program ended with exit code: 0


Surely something is wrong here with the 8.3 update to Xcode as this worked before.

+1, you're not alone.

I noticed this issue today in one of my computer science classes. Drove me crazy for a bit considering my code worked perfectly fine on the school computers.


Downgrading to 8.2.1 until this is fixed.

Hey man, i also had the same problem just now. Thought my code was bugged but that wouldnt make sense because i havnt touched it and the only difference was the update. I am also downgrading. I hate that they released this update and bugged it for C++ coders... seriously??


Never updating xcode ever again.

Surely something is wrong here with the 8.3 uodate to Xcode as this worked before.

Given that this is causing problems for lots of folks, please do file a bug report about it. I’d also appreciate you posting your bug number here, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I have been experiencing the same. Just submitted a bug report.

Bug Number: 31343395

Thanks. Hopefully this can get sorted soon.


I just wasn't sure if it was just me or if this was a general issue.

Have the same issue. Even if you just run

cout << "Hello world";

The output window just disappears and if you drag it up, there's no output.

After troubling shooting for an entire day and going a little mad, I have finally found out its not me, its you xcode! This bug has screwed me over so badly, somehow nice to know i'm not alone 🙂


I will downgrade to the previous version, thanks man.

Happy to find this! I was going nuts checking my build paths and debugging until I noticed the cin statements seemed to be the issue. Just submitted a bug report as well. As a student who has solely used Xcode for c++ development, I really hope this is resolved before my final projects are due!

I have the same problem. It has been stressing me these past few days 😟

I too study CS and was on a C++ assignment.


Just downgrade to 8.2.X instead

Glad to see that I was not the only one who experienced this! Hope it will be fixed soon 🙂

My Bug Report number: 31438693

Im also having problems with this new version of xcode, i couldn't get it to run a simple printf, it doesn't show anything after runnig it.

how do i do downgrade to 8.2.1?

how do i do downgrade to 8.2.1?

You can download old versions of Xcode from the developer downloads page.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I'm having the same issue. However, I've found that while cout << "Hello, World!"; won't output, cout << "Hello, World!\n"; will.

Xcode 8.3 c++ issues using cout and cin on same line
 
 
Q