I am a complete beginner. I just downloaded xCode today. Here is a screenshot of what I have:
As you can see, I successfully ran the program, however, I can't see any out put anywhere. Where is it and how do I see it?
It does not look like the program has run at all, only built. The status up at the top says build succeeded, not run succeeded. Command-R will run the program.
Here is what it will look like when you run the program:
Also you can use the Log Navigator to go and see results from previous build and debug sessions.
You will often see tutorial programs written for Windows where the program ends with asking the user for input. The reason for this is that the console model on Windows has the program owning the console window, so the window will disappear as soon as the program exits. So by asking for input as the last thing the program will keep running until the user gives it that input, whereupon it the program will complete and the console window will disappear.
Non-Windows platforms don't behave this way and generally do not require such code.
Put a breakpoint at the return statement or a getchar() before return. The reason you're not seeing the output is because the console closes when the program exits. So the above points prevent the program from ending.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With