Basically i am running a simple program in Xcode Version 8.3 (8E162)
#include <iostream>
using namespace std;
int main() {
int a;
cout << "What is your age: ";
cin >> a;
cout << "My age is " << a << endl;
return 0;
}
I have seen different questions about cout
need to be flushed and all std::cout won't print and Xcode debugger not showing C++ cout output. The Xcode debugger does not print cout
until i put \n or endl
. But, it works perfectly fine on terminal.
What if i had to use What is your age:
and the user input age in the single line rather than the next line putting \n and endl
?
This is what the Xcode debugger shows after build and run
This is when user inputs and it displays the result
This is on the terminal and this is what exactly what i need the output on the Xcode debugger.