VS2010 to write a simple console application, operation results about no flash,

VS2010 to write a simple console application, operation results about no flash in front of return, 0; and system ("Pause"); Dos window can stay, why? Is it right? What set has the problem, can not add system ("Pause"); Dos window can also stay, under normal circumstances should be without.

Started by Clark at February 07, 2016 - 8:57 AM

Add a getchar (or sleep); (1000); also can
The main program is executed on the end of the program, to wait a moment!

Posted by Jennifer at February 08, 2016 - 9:13 AM

Is not a set of problems. System ("Pause") you are using the pause command.
You open a CMD command prompt, enter the pause try what will happen.
Then in your code in the system ("Pause") with system ("ipconfig").

Posted by Jennie at February 14, 2016 - 10:02 AM

Positive solutions, you return 0 function out of the exit from the console, the getchar () will always wait for you to enter a character, sleep (1000) in the program after the completion of waiting for 1000ms to exit.

Posted by Craig at February 25, 2016 - 10:47 AM

Or if you open a DOS window, use the command line to run, so do not add system("Pause");

Posted by Quentina at November 12, 2016 - 4:19 AM

Can also use the code:: blocks, without system ("Pause"); window will not disappear

Posted by Quentina at November 25, 2016 - 5:09 AM

We don't have that problem you choose "debugging" menu bar "executive".

Posted by Parker at November 29, 2016 - 5:27 AM

Command to run in the CMD window and enter the following:
cd /Where drive and folder D EXE file
The EXE file

Posted by Horace at December 14, 2016 - 5:41 AM

Sleep()Not in all cases were successfully make the program suspended.
Refer to the MSDN interpretation of Sleep:
This function suspends the execution of the current thread for a specified interval.
That is to say: Sleep just let the current thread suspends execution. For only one thread program, of course is the entire program is suspended, and if the program is multi-threaded, then other threads will continue to execute.

getchar()It is not always successful, see the example below:
int a;
	scanf("%d",&a);
	getchar();

This program can not stop, because the getchar (received)'\n'.
Based on the above, if you want to be successful, let the program of suspension of execution, or system ("pause") insurance.

Posted by Jennie at December 18, 2016 - 6:26 AM

system("pause")And (getchar); the result is the same, is only one character.

In order to insurance, one will not casually knocked character.
For example, 'q', do end marker, read cycle, until I read the character.

Posted by Esther at December 30, 2016 - 6:41 AM

Add a getchar () can also stay upstairs, said very clearly. . .

Posted by Louise at January 02, 2017 - 8:26 AM

The function is complete, the program ends. If you want to see the results determined getchar (); header files#include <conio.h>

Posted by Montague at January 04, 2017 - 7:12 AM

Under normal circumstances are to be added, system () function is a way of interaction between C and system. System ("pause") effects like pause in the console window input. In the C++ can also be added to such a sentence, std::cin.get()

Posted by Victoria at January 13, 2017 - 7:23 AM

Without words, compiled by ctrl+F5, but in the end, the generated exe will flash once there is no.

Posted by Prescott at January 15, 2017 - 7:58 AM