I can successfully run the Hello World program in C ++, but I cannot see and display it. Where is it?

I am a complete newbie. I just downloaded xCode today. Here is a screenshot of what I have:

enter image description here

As you can see, I successfully ran the program, but I can’t see it anywhere. Where is it and how to see it?

+7
source share
2 answers

It does not look like the program is running at all, only built. The status at the top says the build was successful, not successful. The -R command will run the program.

Here's what it will look like when the program starts: Finished running

You can also use Log Navigator to jump to the results of previous build and debugging sessions. Log navigator

You will often see tutorials written for Windows where the program ends with a user request for input. The reason for this is that the console model in Windows has a program that owns a console window, so the window will disappear as soon as the program exits. Therefore, asking for input as the last thing, the program will continue to work until the user gives it this input, after which the program will end and the console window will disappear.

Non-Windows platforms do not behave this way and usually do not require such code.

+5
source

Place a breakpoint on the return or getchar () statement before returning. The reason you do not see the output is because the console closes when you exit the program. Thus, the above items do not allow the program to complete work.

+3
source

All Articles